Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- PrintDialog.cs
- NativeMethods.cs
- DataSourceSelectArguments.cs
- DiscoveryClientOutputChannel.cs
- InstanceKeyCompleteException.cs
- StringDictionaryEditor.cs
- CorruptStoreException.cs
- ListViewItem.cs
- EventProvider.cs
- FileEnumerator.cs
- ScaleTransform.cs
- TreeViewCancelEvent.cs
- PointLightBase.cs
- InternalConfigRoot.cs
- _AutoWebProxyScriptHelper.cs
- AttributeProviderAttribute.cs
- Bidi.cs
- EncryptedReference.cs
- CheckBoxList.cs
- LingerOption.cs
- CodeExpressionCollection.cs
- XmlNodeReader.cs
- JpegBitmapEncoder.cs
- LOSFormatter.cs
- ProfileManager.cs
- ValidatorUtils.cs
- ImmutableAssemblyCacheEntry.cs
- PolyQuadraticBezierSegment.cs
- GenericAuthenticationEventArgs.cs
- MonitoringDescriptionAttribute.cs
- ExpressionTextBox.xaml.cs
- DBBindings.cs
- CheckoutException.cs
- XmlSiteMapProvider.cs
- VarRefManager.cs
- precedingquery.cs
- DetectEofStream.cs
- UnknownBitmapDecoder.cs
- KnownColorTable.cs
- RenderDataDrawingContext.cs
- SettingsProviderCollection.cs
- SessionPageStatePersister.cs
- CancellationTokenRegistration.cs
- ObjectSecurity.cs
- SchemaMapping.cs
- CqlGenerator.cs
- SqlCacheDependency.cs
- QilBinary.cs
- ButtonRenderer.cs
- OverrideMode.cs
- UrlAuthorizationModule.cs
- ProviderIncompatibleException.cs
- EncoderExceptionFallback.cs
- OleDbDataAdapter.cs
- CategoryGridEntry.cs
- ParameterCollection.cs
- NotifyInputEventArgs.cs
- HtmlTableCellCollection.cs
- GenericPrincipal.cs
- MenuCommandsChangedEventArgs.cs
- CookielessHelper.cs
- TabletDeviceInfo.cs
- TreeNodeStyle.cs
- ValueTable.cs
- QilInvoke.cs
- TypedReference.cs
- TextBoxRenderer.cs
- Ray3DHitTestResult.cs
- XPathScanner.cs
- Directory.cs
- RankException.cs
- XmlCharCheckingWriter.cs
- AsymmetricAlgorithm.cs
- RequestQueue.cs
- HtmlTableCellCollection.cs
- HtmlControl.cs
- CodeIdentifiers.cs
- DbConnectionInternal.cs
- unsafenativemethodsother.cs
- mda.cs
- HtmlShimManager.cs
- _ScatterGatherBuffers.cs
- CompilationUtil.cs
- SynchronizationLockException.cs
- KeyValuePair.cs
- SQLInt32Storage.cs
- XmlSignificantWhitespace.cs
- DetailsViewUpdatedEventArgs.cs
- CodeNamespace.cs
- RC2CryptoServiceProvider.cs
- UnmanagedMemoryStream.cs
- EventSetter.cs
- ListItemConverter.cs
- CompareValidator.cs
- ADMembershipProvider.cs
- DbBuffer.cs
- OdbcPermission.cs
- ResourcePermissionBaseEntry.cs
- WebPartZoneDesigner.cs
- BasicHttpSecurityMode.cs