Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / Filter / ZeroOpNode.cs / 1305376 / ZeroOpNode.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data { using System; using System.Collections.Generic; using System.Diagnostics; internal sealed class ZeroOpNode : ExpressionNode { internal readonly int op; internal const int zop_True = 1; internal const int zop_False = 0; internal const int zop_Null = -1; internal ZeroOpNode(int op) : base((DataTable)null) { this.op = op; Debug.Assert(op == Operators.True || op == Operators.False || op == Operators.Null, "Invalid zero-op"); } internal override void Bind(DataTable table, Listlist) { } internal override object Eval() { switch (op) { case Operators.True: return true; case Operators.False: return false; case Operators.Null: return DBNull.Value; default: Debug.Assert(op == Operators.True || op == Operators.False || op == Operators.Null, "Invalid zero-op"); return DBNull.Value; } } internal override object Eval(DataRow row, DataRowVersion version) { return Eval(); } internal override object Eval(int[] recordNos) { return Eval(); } internal override bool IsConstant() { return true; } internal override bool IsTableConstant() { return true; } internal override bool HasLocalAggregate() { return false; } internal override bool HasRemoteAggregate() { return false; } internal override ExpressionNode Optimize() { return this; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data { using System; using System.Collections.Generic; using System.Diagnostics; internal sealed class ZeroOpNode : ExpressionNode { internal readonly int op; internal const int zop_True = 1; internal const int zop_False = 0; internal const int zop_Null = -1; internal ZeroOpNode(int op) : base((DataTable)null) { this.op = op; Debug.Assert(op == Operators.True || op == Operators.False || op == Operators.Null, "Invalid zero-op"); } internal override void Bind(DataTable table, Listlist) { } internal override object Eval() { switch (op) { case Operators.True: return true; case Operators.False: return false; case Operators.Null: return DBNull.Value; default: Debug.Assert(op == Operators.True || op == Operators.False || op == Operators.Null, "Invalid zero-op"); return DBNull.Value; } } internal override object Eval(DataRow row, DataRowVersion version) { return Eval(); } internal override object Eval(int[] recordNos) { return Eval(); } internal override bool IsConstant() { return true; } internal override bool IsTableConstant() { return true; } internal override bool HasLocalAggregate() { return false; } internal override bool HasRemoteAggregate() { return false; } internal override ExpressionNode Optimize() { return this; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UITypeEditor.cs
- CodeLinePragma.cs
- ResolveMatches11.cs
- FontEmbeddingManager.cs
- MethodBuilder.cs
- AbandonedMutexException.cs
- CodeIterationStatement.cs
- RequestQueryProcessor.cs
- Qualifier.cs
- WebBrowsableAttribute.cs
- ZipIOModeEnforcingStream.cs
- QueueProcessor.cs
- RegexGroupCollection.cs
- LifetimeServices.cs
- IPHostEntry.cs
- SQLString.cs
- SessionSwitchEventArgs.cs
- MSHTMLHost.cs
- IdentityManager.cs
- File.cs
- UnsafeNativeMethodsCLR.cs
- HighlightVisual.cs
- Parsers.cs
- XmlDictionaryString.cs
- AutoGeneratedFieldProperties.cs
- NativeMethods.cs
- DependencyPropertyChangedEventArgs.cs
- WebBrowsableAttribute.cs
- MediaEntryAttribute.cs
- ResourceDefaultValueAttribute.cs
- ProvideValueServiceProvider.cs
- TypeConverterBase.cs
- ReaderContextStackData.cs
- HttpCapabilitiesBase.cs
- Label.cs
- DriveNotFoundException.cs
- HttpRuntime.cs
- Exceptions.cs
- CngKeyCreationParameters.cs
- XmlSchemaCompilationSettings.cs
- PageWrapper.cs
- OrderedDictionaryStateHelper.cs
- IERequestCache.cs
- NativeWrapper.cs
- InputLanguage.cs
- StrokeNodeEnumerator.cs
- VirtualizingPanel.cs
- VariableQuery.cs
- AdRotator.cs
- PerfCounters.cs
- Nullable.cs
- HtmlImage.cs
- AttachInfo.cs
- XmlToDatasetMap.cs
- Matrix.cs
- ErrorHandlerFaultInfo.cs
- TextContainer.cs
- RawStylusActions.cs
- AdornerPresentationContext.cs
- DATA_BLOB.cs
- StandardCommandToolStripMenuItem.cs
- HttpHeaderCollection.cs
- ActivityMarkupSerializationProvider.cs
- ItemAutomationPeer.cs
- BitmapFrameDecode.cs
- XmlSchemaInclude.cs
- DataGridViewTextBoxColumn.cs
- EntityDesignerUtils.cs
- XmlStreamStore.cs
- XmlSchemaDocumentation.cs
- GroupByExpressionRewriter.cs
- COM2ExtendedTypeConverter.cs
- DataBoundLiteralControl.cs
- ExtensionWindowResizeGrip.cs
- SqlDataSourceConnectionPanel.cs
- AlignmentYValidation.cs
- TimeoutValidationAttribute.cs
- RectValueSerializer.cs
- CapabilitiesPattern.cs
- EdmError.cs
- IdentitySection.cs
- DecimalMinMaxAggregationOperator.cs
- PublishLicense.cs
- SourceElementsCollection.cs
- DocumentEventArgs.cs
- HttpModuleAction.cs
- CompilerGlobalScopeAttribute.cs
- EditorZoneAutoFormat.cs
- RectConverter.cs
- DataGridViewButtonColumn.cs
- KeyFrames.cs
- HitTestWithGeometryDrawingContextWalker.cs
- EntitySqlQueryBuilder.cs
- ManagementOperationWatcher.cs
- BamlResourceContent.cs
- PointKeyFrameCollection.cs
- SQLSingle.cs
- ImageDrawing.cs
- SpecialFolderEnumConverter.cs
- ServerType.cs