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
- ValidationHelper.cs
- Int32CollectionConverter.cs
- SemanticTag.cs
- DNS.cs
- XmlSchemaObject.cs
- HwndHost.cs
- ActiveDesignSurfaceEvent.cs
- ProfileSettings.cs
- ExpressionPrefixAttribute.cs
- WebPartDisplayModeCollection.cs
- TypeUsageBuilder.cs
- BitmapPalettes.cs
- WinInet.cs
- OptimisticConcurrencyException.cs
- ImportException.cs
- SqlBulkCopy.cs
- PackageDigitalSignatureManager.cs
- WebPartZone.cs
- SvcMapFileLoader.cs
- Rect3DValueSerializer.cs
- Light.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- Receive.cs
- Repeater.cs
- HashMembershipCondition.cs
- PropertyChange.cs
- TextEditorMouse.cs
- PackWebRequest.cs
- ConversionHelper.cs
- WebEventTraceProvider.cs
- CodeStatementCollection.cs
- ReturnEventArgs.cs
- IgnorePropertiesAttribute.cs
- ProfileInfo.cs
- DocumentXmlWriter.cs
- _AutoWebProxyScriptHelper.cs
- httpapplicationstate.cs
- CustomAttributeBuilder.cs
- SQLMoneyStorage.cs
- Vector3DCollectionConverter.cs
- BinHexDecoder.cs
- infer.cs
- NumericUpDown.cs
- PassportAuthenticationModule.cs
- TextTreeRootNode.cs
- EdmItemCollection.cs
- CSharpCodeProvider.cs
- XmlSecureResolver.cs
- WebPartDescription.cs
- TypeDefinition.cs
- XPathSelfQuery.cs
- CompilerState.cs
- ExpressionBinding.cs
- SmtpAuthenticationManager.cs
- IdentityModelDictionary.cs
- HttpFileCollection.cs
- ClientUrlResolverWrapper.cs
- FormatVersion.cs
- DSASignatureFormatter.cs
- ObjectSet.cs
- nulltextcontainer.cs
- ScrollableControl.cs
- FileLevelControlBuilderAttribute.cs
- DataControlFieldCell.cs
- SqlNotificationEventArgs.cs
- Freezable.cs
- SqlEnums.cs
- TreeViewItemAutomationPeer.cs
- Ipv6Element.cs
- FileRecordSequenceCompletedAsyncResult.cs
- EntityDesignerUtils.cs
- CancelEventArgs.cs
- HttpContextServiceHost.cs
- EndpointAddressMessageFilterTable.cs
- BevelBitmapEffect.cs
- UnmanagedMemoryStream.cs
- EditorZoneAutoFormat.cs
- Rules.cs
- SchemaImporter.cs
- KeyValuePairs.cs
- HiddenField.cs
- SvcMapFileSerializer.cs
- Cursor.cs
- AppLevelCompilationSectionCache.cs
- MsmqNonTransactedPoisonHandler.cs
- EllipseGeometry.cs
- SafeCertificateStore.cs
- ExtenderHelpers.cs
- CallbackHandler.cs
- ToolTip.cs
- SqlFormatter.cs
- Dynamic.cs
- PropertyMapper.cs
- TextSchema.cs
- IImplicitResourceProvider.cs
- TableLayoutCellPaintEventArgs.cs
- DBSchemaRow.cs
- RectAnimationUsingKeyFrames.cs
- NamedPermissionSet.cs
- Int32Animation.cs