Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Common / Utils / Boolean / Literal.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridItemCollection.cs
- TryExpression.cs
- GridView.cs
- StackOverflowException.cs
- ImageFormat.cs
- RectangleF.cs
- OutOfMemoryException.cs
- Point4D.cs
- SourceChangedEventArgs.cs
- Button.cs
- IIS7UserPrincipal.cs
- JavaScriptSerializer.cs
- WebEventTraceProvider.cs
- ConnectionStringEditor.cs
- Identifier.cs
- UnmanagedMemoryStreamWrapper.cs
- GeneralTransform3D.cs
- activationcontext.cs
- SemanticResultKey.cs
- PropertyConverter.cs
- RectangleGeometry.cs
- ConfigurationSectionCollection.cs
- LinqExpressionNormalizer.cs
- XpsFont.cs
- ProjectedWrapper.cs
- Statements.cs
- WebPartRestoreVerb.cs
- Span.cs
- ToolStripContentPanelRenderEventArgs.cs
- DataGridViewCellFormattingEventArgs.cs
- CustomLineCap.cs
- PeerHopCountAttribute.cs
- EventMetadata.cs
- OutputScopeManager.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- LocalizationParserHooks.cs
- unitconverter.cs
- LinkTarget.cs
- FormsAuthentication.cs
- followingsibling.cs
- SecondaryIndexList.cs
- DataViewManagerListItemTypeDescriptor.cs
- FileNotFoundException.cs
- EntityException.cs
- NumberFormatInfo.cs
- EventWaitHandleSecurity.cs
- WebPartDescription.cs
- TripleDESCryptoServiceProvider.cs
- LinkConverter.cs
- EmptyEnumerator.cs
- Registry.cs
- CqlErrorHelper.cs
- Section.cs
- ContentDisposition.cs
- CacheForPrimitiveTypes.cs
- ConfigurationPropertyAttribute.cs
- QilTypeChecker.cs
- SkewTransform.cs
- ConsumerConnectionPointCollection.cs
- CatalogPartCollection.cs
- UnmanagedMarshal.cs
- XmlChoiceIdentifierAttribute.cs
- ParameterToken.cs
- HTTPNotFoundHandler.cs
- ToolStripEditorManager.cs
- WebProxyScriptElement.cs
- XPathNavigatorReader.cs
- Screen.cs
- VersionedStream.cs
- XsltArgumentList.cs
- Encoder.cs
- SqlNamer.cs
- Span.cs
- SoapCommonClasses.cs
- PreservationFileWriter.cs
- SecurityManager.cs
- ProfileServiceManager.cs
- EncryptedData.cs
- ListInitExpression.cs
- BitHelper.cs
- UniqueEventHelper.cs
- initElementDictionary.cs
- SourceSwitch.cs
- NumericUpDown.cs
- StringHandle.cs
- X509Chain.cs
- ControlCollection.cs
- FixedSOMPageElement.cs
- KeyProperty.cs
- SmiConnection.cs
- ValueTable.cs
- EncoderBestFitFallback.cs
- NonBatchDirectoryCompiler.cs
- SimpleWebHandlerParser.cs
- ThreadAbortException.cs
- BinaryFormatterWriter.cs
- ProcessHost.cs
- CodeConstructor.cs
- TextContainerHelper.cs
- MSG.cs