Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataEntity / System / Data / Common / Utils / Boolean / Literal.cs / 2 / Literal.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; using System.Globalization; using System.Collections.ObjectModel; using System.Diagnostics; namespace System.Data.Common.Utils.Boolean { ////// Represents a literal in a normal form expression of the form: /// /// Term /// /// or /// /// !Term /// ///internal sealed class Literal : NormalFormNode , IEquatable > { private readonly TermExpr _term; private readonly bool _isTermPositive; /// /// Initialize a new literal. /// /// Term /// Sign of term internal Literal(TermExprterm, bool isTermPositive) : base(isTermPositive ? (BoolExpr )term : (BoolExpr )new NotExpr (term)) { Debug.Assert(null != term); _term = term; _isTermPositive = isTermPositive; } /// /// Gets literal term. /// internal TermExprTerm { get { return _term; } } /// /// Gets sign of term. /// internal bool IsTermPositive { get { return _isTermPositive; } } ////// Creates a negated version of this literal. /// ///!this internal LiteralMakeNegated() { return IdentifierService .Instance.NegateLiteral(this); } public override string ToString() { return StringUtil.FormatInvariant("{0}{1}", _isTermPositive ? String.Empty : "!", _term); } public override bool Equals(object obj) { Debug.Fail("use typed Equals"); return Equals(obj as Literal ); } public bool Equals(Literal other) { return null != other && other._isTermPositive == _isTermPositive && other._term.Equals(_term); } public override int GetHashCode() { return _term.GetHashCode(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; using System.Globalization; using System.Collections.ObjectModel; using System.Diagnostics; namespace System.Data.Common.Utils.Boolean { ////// Represents a literal in a normal form expression of the form: /// /// Term /// /// or /// /// !Term /// ///internal sealed class Literal : NormalFormNode , IEquatable > { private readonly TermExpr _term; private readonly bool _isTermPositive; /// /// Initialize a new literal. /// /// Term /// Sign of term internal Literal(TermExprterm, bool isTermPositive) : base(isTermPositive ? (BoolExpr )term : (BoolExpr )new NotExpr (term)) { Debug.Assert(null != term); _term = term; _isTermPositive = isTermPositive; } /// /// Gets literal term. /// internal TermExprTerm { get { return _term; } } /// /// Gets sign of term. /// internal bool IsTermPositive { get { return _isTermPositive; } } ////// Creates a negated version of this literal. /// ///!this internal LiteralMakeNegated() { return IdentifierService .Instance.NegateLiteral(this); } public override string ToString() { return StringUtil.FormatInvariant("{0}{1}", _isTermPositive ? String.Empty : "!", _term); } public override bool Equals(object obj) { Debug.Fail("use typed Equals"); return Equals(obj as Literal ); } public bool Equals(Literal other) { return null != other && other._isTermPositive == _isTermPositive && other._term.Equals(_term); } public override int GetHashCode() { return _term.GetHashCode(); } } } // 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
- ReadOnlyDataSourceView.cs
- WmpBitmapDecoder.cs
- KeyTimeConverter.cs
- PropertyGrid.cs
- pingexception.cs
- SelectionItemProviderWrapper.cs
- UserNameSecurityToken.cs
- FilePrompt.cs
- AttributeUsageAttribute.cs
- BatchWriter.cs
- DateTimeFormatInfoScanner.cs
- EditorServiceContext.cs
- Wildcard.cs
- PngBitmapDecoder.cs
- WmpBitmapEncoder.cs
- ValueOfAction.cs
- RangeValuePatternIdentifiers.cs
- PartitionResolver.cs
- ContentPlaceHolder.cs
- HostingEnvironment.cs
- PerformanceCounterPermission.cs
- ColorDialog.cs
- XPathNavigator.cs
- PixelFormats.cs
- Padding.cs
- TransformConverter.cs
- PageWrapper.cs
- Thread.cs
- SqlExpander.cs
- X509Chain.cs
- ViewSimplifier.cs
- Nullable.cs
- ZoneMembershipCondition.cs
- Int16AnimationBase.cs
- XD.cs
- StrongNamePublicKeyBlob.cs
- X509SecurityTokenAuthenticator.cs
- EndEvent.cs
- SecurityManager.cs
- _DigestClient.cs
- RubberbandSelector.cs
- MaskInputRejectedEventArgs.cs
- Int32.cs
- TabControlEvent.cs
- DataSourceView.cs
- CodeTypeMember.cs
- UICuesEvent.cs
- TraceRecord.cs
- StateInitialization.cs
- TextClipboardData.cs
- TimersDescriptionAttribute.cs
- PixelFormat.cs
- UmAlQuraCalendar.cs
- RelationshipEntry.cs
- FormClosingEvent.cs
- FlowDocumentReaderAutomationPeer.cs
- PtsCache.cs
- JoinElimination.cs
- AggregateNode.cs
- DataSetSchema.cs
- WindowsFormsHelpers.cs
- WebPartEditorCancelVerb.cs
- CapabilitiesState.cs
- TypePresenter.xaml.cs
- DefaultValidator.cs
- FileDataSourceCache.cs
- CacheModeConverter.cs
- EntityProxyFactory.cs
- SerializationStore.cs
- OutputScopeManager.cs
- EntityViewGenerator.cs
- NameValueCollection.cs
- ReferentialConstraint.cs
- BuildResultCache.cs
- StringExpressionSet.cs
- GZipDecoder.cs
- RelationshipDetailsRow.cs
- smtpconnection.cs
- Math.cs
- MouseGestureConverter.cs
- RemoteWebConfigurationHostServer.cs
- FixedSchema.cs
- EventRouteFactory.cs
- PaintEvent.cs
- XhtmlTextWriter.cs
- StateChangeEvent.cs
- CommonDialog.cs
- PerformanceCounterPermission.cs
- ByteAnimationUsingKeyFrames.cs
- Stylesheet.cs
- IndicFontClient.cs
- PenThreadWorker.cs
- EncryptedType.cs
- CommandManager.cs
- Ray3DHitTestResult.cs
- DropDownButton.cs
- PipelineModuleStepContainer.cs
- Quad.cs
- Cursor.cs
- RangeBaseAutomationPeer.cs