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
- AppModelKnownContentFactory.cs
- PolicyManager.cs
- LookupNode.cs
- GatewayDefinition.cs
- DrawingContext.cs
- SQLInt16.cs
- SuppressMessageAttribute.cs
- CodeCatchClause.cs
- StandardRuntimeEnumValidator.cs
- messageonlyhwndwrapper.cs
- XPathNodeInfoAtom.cs
- BindingsSection.cs
- SharedStatics.cs
- GreenMethods.cs
- FixUpCollection.cs
- RoleManagerModule.cs
- DataTablePropertyDescriptor.cs
- WindowsTreeView.cs
- ConfigXmlElement.cs
- ConstraintEnumerator.cs
- SafeCryptoHandles.cs
- DbDeleteCommandTree.cs
- PathFigure.cs
- CodeDirectionExpression.cs
- FormViewCommandEventArgs.cs
- SelectionItemPattern.cs
- Wildcard.cs
- Signature.cs
- XmlSchemaAppInfo.cs
- SqlUserDefinedTypeAttribute.cs
- Int16.cs
- GridToolTip.cs
- UpDownBase.cs
- EdmItemCollection.cs
- AttributeEmitter.cs
- ObjectParameterCollection.cs
- WebConfigurationFileMap.cs
- RegularExpressionValidator.cs
- CustomErrorsSection.cs
- ProgressBarAutomationPeer.cs
- MemberListBinding.cs
- Lease.cs
- ChannelServices.cs
- SystemFonts.cs
- WizardStepBase.cs
- ReadOnlyHierarchicalDataSource.cs
- XamlSerializationHelper.cs
- XamlBrushSerializer.cs
- Visual3D.cs
- ellipse.cs
- PeerCollaboration.cs
- TabItemWrapperAutomationPeer.cs
- Message.cs
- StoreConnection.cs
- Guid.cs
- FragmentQuery.cs
- Constraint.cs
- Button.cs
- CellIdBoolean.cs
- _ShellExpression.cs
- CriticalHandle.cs
- DomNameTable.cs
- storepermissionattribute.cs
- RuntimeArgumentHandle.cs
- UnionQueryOperator.cs
- EntityCommandCompilationException.cs
- LogExtent.cs
- ColumnHeaderCollectionEditor.cs
- WebSysDescriptionAttribute.cs
- TableSectionStyle.cs
- HebrewCalendar.cs
- LayoutInformation.cs
- OuterGlowBitmapEffect.cs
- XsltInput.cs
- BoolExpr.cs
- Int16Converter.cs
- ModuleElement.cs
- XmlSchemaSimpleTypeUnion.cs
- HandledEventArgs.cs
- MarshalByValueComponent.cs
- PrivilegedConfigurationManager.cs
- ComplexPropertyEntry.cs
- DBPropSet.cs
- GZipDecoder.cs
- XPathAncestorQuery.cs
- FontInfo.cs
- SourceInterpreter.cs
- CacheVirtualItemsEvent.cs
- VirtualPath.cs
- MaskedTextBoxDesigner.cs
- ISO2022Encoding.cs
- FormCollection.cs
- MultipartContentParser.cs
- DispatchWrapper.cs
- AsyncStreamReader.cs
- ThreadStaticAttribute.cs
- SystemInfo.cs
- XmlEnumAttribute.cs
- SnapLine.cs
- Enlistment.cs