Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Common / Utils / Boolean / Literal.cs / 1 / 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
- Serializer.cs
- ProcessHostConfigUtils.cs
- DataGridViewSelectedColumnCollection.cs
- ProtocolsConfigurationEntry.cs
- SqlClientFactory.cs
- ChildChangedEventArgs.cs
- WorkflowApplicationCompletedEventArgs.cs
- _NestedSingleAsyncResult.cs
- ValidationRuleCollection.cs
- MenuItem.cs
- FrameworkEventSource.cs
- PnrpPeerResolver.cs
- ParameterToken.cs
- CorrelationTokenInvalidatedHandler.cs
- ClientScriptManagerWrapper.cs
- DependencyObjectPropertyDescriptor.cs
- ContextMenuStrip.cs
- PointLight.cs
- WebPartVerb.cs
- MetadataCacheItem.cs
- MediaElementAutomationPeer.cs
- SessionEndedEventArgs.cs
- SystemIPInterfaceProperties.cs
- AnnotationMap.cs
- SerializerDescriptor.cs
- TypeLibraryHelper.cs
- TypedMessageConverter.cs
- ConnectionConsumerAttribute.cs
- GlyphTypeface.cs
- DetailsViewDesigner.cs
- InsufficientMemoryException.cs
- BitmapInitialize.cs
- DataGridViewCellMouseEventArgs.cs
- SystemDropShadowChrome.cs
- RtfToXamlLexer.cs
- IsolatedStorageException.cs
- IsolatedStoragePermission.cs
- TextBoxBase.cs
- AutomationPeer.cs
- MailDefinitionBodyFileNameEditor.cs
- NameValueSectionHandler.cs
- TemplatePropertyEntry.cs
- Overlapped.cs
- MetadataUtilsSmi.cs
- SqlFileStream.cs
- SqlNode.cs
- CacheMemory.cs
- RecipientIdentity.cs
- ResourceExpressionEditor.cs
- StringSource.cs
- AlgoModule.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- SHA256.cs
- HandleRef.cs
- baseaxisquery.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- EventSetter.cs
- OleDbInfoMessageEvent.cs
- VersionPair.cs
- ActivationServices.cs
- TranslateTransform.cs
- bidPrivateBase.cs
- listviewsubitemcollectioneditor.cs
- InfiniteIntConverter.cs
- LeaseManager.cs
- EncryptedReference.cs
- TargetControlTypeAttribute.cs
- XmlSchemaParticle.cs
- MediaScriptCommandRoutedEventArgs.cs
- DebugView.cs
- Int32Rect.cs
- WebContentFormatHelper.cs
- ExpandSegment.cs
- XPathNodePointer.cs
- GridViewRowPresenter.cs
- HtmlMeta.cs
- SafeCryptHandles.cs
- OdbcStatementHandle.cs
- HandlerFactoryCache.cs
- EntityContainerEmitter.cs
- Add.cs
- ServiceChannelProxy.cs
- WebPartEventArgs.cs
- StringPropertyBuilder.cs
- XmlILStorageConverter.cs
- Int32Rect.cs
- PingOptions.cs
- MimeObjectFactory.cs
- ProviderConnectionPointCollection.cs
- WindowsSolidBrush.cs
- VirtualPathProvider.cs
- ImageDrawing.cs
- MetafileHeader.cs
- XsltCompileContext.cs
- ResXFileRef.cs
- XmlSchemaSimpleTypeUnion.cs
- ComponentResourceKeyConverter.cs
- ButtonBaseAutomationPeer.cs
- ZipIOLocalFileDataDescriptor.cs
- SecurityHeaderLayout.cs