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
- ToolStripSystemRenderer.cs
- CachingHintValidation.cs
- ParseChildrenAsPropertiesAttribute.cs
- Rotation3D.cs
- HtmlString.cs
- DataGridColumnCollection.cs
- ObjectDataSourceSelectingEventArgs.cs
- CollectionViewGroupInternal.cs
- RegistryPermission.cs
- SelectiveScrollingGrid.cs
- XComponentModel.cs
- DragStartedEventArgs.cs
- DataServiceException.cs
- SevenBitStream.cs
- AutomationProperty.cs
- JournalEntryStack.cs
- PathGradientBrush.cs
- UpDownEvent.cs
- IgnoreFileBuildProvider.cs
- SamlAudienceRestrictionCondition.cs
- PartialList.cs
- ChannelOptions.cs
- DataGridLinkButton.cs
- ConstraintCollection.cs
- AggregationMinMaxHelpers.cs
- ConnectionStringsExpressionBuilder.cs
- SmtpNtlmAuthenticationModule.cs
- SimpleTypeResolver.cs
- DataSet.cs
- DragDrop.cs
- DropSource.cs
- XmlSchemaObjectCollection.cs
- XmlSchemaSimpleType.cs
- LOSFormatter.cs
- SoapObjectWriter.cs
- InternalControlCollection.cs
- WeakReferenceEnumerator.cs
- DocumentGridContextMenu.cs
- StylusPlugInCollection.cs
- GenericUriParser.cs
- UIHelper.cs
- SingleTagSectionHandler.cs
- Point4D.cs
- Vector.cs
- CryptoKeySecurity.cs
- DbConnectionInternal.cs
- _PooledStream.cs
- MemoryFailPoint.cs
- KeyManager.cs
- XmlNodeList.cs
- BlockUIContainer.cs
- RadioButtonStandardAdapter.cs
- QueryPageSettingsEventArgs.cs
- ModelUtilities.cs
- ComponentCollection.cs
- SslStream.cs
- Win32SafeHandles.cs
- WebUtil.cs
- SqlBulkCopy.cs
- LocationSectionRecord.cs
- SizeConverter.cs
- CodeRemoveEventStatement.cs
- Validator.cs
- _AutoWebProxyScriptWrapper.cs
- ParallelRangeManager.cs
- DataStorage.cs
- PathHelper.cs
- Transform3DGroup.cs
- HostTimeoutsElement.cs
- IgnoreDataMemberAttribute.cs
- FilterQuery.cs
- XmlAnyAttributeAttribute.cs
- DynamicFilterExpression.cs
- ApplicationDirectory.cs
- GetPageCompletedEventArgs.cs
- TypeGeneratedEventArgs.cs
- GridViewCancelEditEventArgs.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- XPathArrayIterator.cs
- ContainerControl.cs
- TrustSection.cs
- WorkerProcess.cs
- ConvertBinder.cs
- ObjectPropertyMapping.cs
- RelationshipDetailsCollection.cs
- HwndMouseInputProvider.cs
- GridViewDeletedEventArgs.cs
- RelationshipEntry.cs
- CounterSet.cs
- LicenseException.cs
- RestClientProxyHandler.cs
- shaperfactoryquerycacheentry.cs
- OdbcParameterCollection.cs
- RefreshPropertiesAttribute.cs
- CompiledRegexRunnerFactory.cs
- Panel.cs
- LinkDesigner.cs
- GlobalProxySelection.cs
- TopClause.cs
- ResourceDisplayNameAttribute.cs