Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Data / System / Data / Filter / ZeroOpNode.cs / 1 / 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, List list) {
}
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, List list) {
}
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
- SerializationSectionGroup.cs
- IPGlobalProperties.cs
- TextRange.cs
- TabControlCancelEvent.cs
- ContainerSelectorActiveEvent.cs
- SplitterPanel.cs
- MimeWriter.cs
- PublisherIdentityPermission.cs
- Matrix3D.cs
- WorkflowTraceTransfer.cs
- TextBox.cs
- SemaphoreFullException.cs
- HtmlInputReset.cs
- FormsAuthenticationUser.cs
- TextSpan.cs
- DoubleLink.cs
- BindingNavigator.cs
- DesigntimeLicenseContext.cs
- FileClassifier.cs
- ServiceModelConfigurationSection.cs
- Wildcard.cs
- XmlExtensionFunction.cs
- NativeMethods.cs
- ColorTransform.cs
- PointConverter.cs
- AuthenticationManager.cs
- GenericPrincipal.cs
- OracleParameter.cs
- TimeoutException.cs
- IApplicationTrustManager.cs
- NumericUpDownAcceleration.cs
- EntityContainerEntitySet.cs
- ListBindingHelper.cs
- SmiContextFactory.cs
- GenericPrincipal.cs
- DeferredTextReference.cs
- FamilyTypeface.cs
- EncodingTable.cs
- Zone.cs
- NavigateUrlConverter.cs
- SettingsPropertyCollection.cs
- LoadRetryStrategyFactory.cs
- EditingCommands.cs
- TypeExtension.cs
- ObjectFullSpanRewriter.cs
- DrawingDrawingContext.cs
- DBCommandBuilder.cs
- HasCopySemanticsAttribute.cs
- Vars.cs
- ServiceDiscoveryBehavior.cs
- ManagedFilter.cs
- cryptoapiTransform.cs
- ImageAnimator.cs
- Calendar.cs
- ListViewUpdatedEventArgs.cs
- BindingSource.cs
- SamlNameIdentifierClaimResource.cs
- XamlParser.cs
- DurableMessageDispatchInspector.cs
- StringSource.cs
- ListenerElementsCollection.cs
- ServiceOperationUIEditor.cs
- DataControlField.cs
- Vars.cs
- ImpersonateTokenRef.cs
- SQLMoney.cs
- MethodSignatureGenerator.cs
- SapiRecoInterop.cs
- ScriptControl.cs
- ControlBindingsCollection.cs
- PublisherMembershipCondition.cs
- MediaTimeline.cs
- GridItemCollection.cs
- UnmanagedMemoryStream.cs
- HtmlTernaryTree.cs
- BaseValidatorDesigner.cs
- ApplicationSecurityInfo.cs
- MapPathBasedVirtualPathProvider.cs
- ConfigXmlSignificantWhitespace.cs
- HtmlGenericControl.cs
- NativeActivityAbortContext.cs
- MenuRenderer.cs
- ConfigurationLockCollection.cs
- AstTree.cs
- StickyNoteContentControl.cs
- WasHttpHandlersInstallComponent.cs
- ScriptBehaviorDescriptor.cs
- CodeExpressionStatement.cs
- MethodToken.cs
- DataServiceHost.cs
- ApplicationManager.cs
- DateTimeUtil.cs
- contentDescriptor.cs
- DbConnectionPoolGroupProviderInfo.cs
- SqlProcedureAttribute.cs
- TextElementEnumerator.cs
- EventBuilder.cs
- HostingEnvironmentException.cs
- XmlBufferReader.cs
- SelectionWordBreaker.cs