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
- BindingList.cs
- CompositeActivityCodeGenerator.cs
- WebPartMinimizeVerb.cs
- WasEndpointConfigContainer.cs
- DocumentGridContextMenu.cs
- ColorConverter.cs
- ParagraphVisual.cs
- TypeBuilder.cs
- GenericRootAutomationPeer.cs
- PolyLineSegmentFigureLogic.cs
- storepermission.cs
- ServiceOperation.cs
- DisposableCollectionWrapper.cs
- PackagePart.cs
- ExceptionUtil.cs
- TextWriterEngine.cs
- SchemaManager.cs
- ScriptHandlerFactory.cs
- ParameterCollection.cs
- PageFunction.cs
- DataPagerFieldItem.cs
- ObjectDisposedException.cs
- ConsumerConnectionPoint.cs
- TypeInfo.cs
- ProbeDuplexCD1AsyncResult.cs
- XmlSchemaImporter.cs
- SortedList.cs
- Rijndael.cs
- DbMetaDataCollectionNames.cs
- BrowserDefinitionCollection.cs
- SystemWebCachingSectionGroup.cs
- ButtonFlatAdapter.cs
- ManifestSignedXml.cs
- EditorPart.cs
- PropertyGridCommands.cs
- TextBlockAutomationPeer.cs
- WebRequestModulesSection.cs
- MultiAsyncResult.cs
- XmlAnyAttributeAttribute.cs
- XmlSchemaAll.cs
- BamlBinaryReader.cs
- RootAction.cs
- SiteMapPath.cs
- CompositeFontInfo.cs
- ErrorWrapper.cs
- StringConverter.cs
- __Filters.cs
- DBCSCodePageEncoding.cs
- SafeViewOfFileHandle.cs
- AccessDataSource.cs
- AutomationFocusChangedEventArgs.cs
- DictionarySectionHandler.cs
- SecurityVersion.cs
- _ConnectOverlappedAsyncResult.cs
- BrowserCapabilitiesCompiler.cs
- QilLoop.cs
- WorkflowInstanceQuery.cs
- SelectionPattern.cs
- SqlWebEventProvider.cs
- CodeGenerationManager.cs
- InvokeBinder.cs
- PermissionListSet.cs
- BinHexDecoder.cs
- ClockGroup.cs
- BinaryReader.cs
- BackgroundWorker.cs
- CacheHelper.cs
- ScaleTransform.cs
- HttpRawResponse.cs
- KeySpline.cs
- ClaimSet.cs
- CacheChildrenQuery.cs
- GeneralTransform3DGroup.cs
- ShapingEngine.cs
- PathFigureCollection.cs
- RequestQueue.cs
- _BasicClient.cs
- XmlSchemaType.cs
- DbFunctionCommandTree.cs
- SqlException.cs
- WmlImageAdapter.cs
- WbmpConverter.cs
- AnnotationResource.cs
- _ShellExpression.cs
- ObjectResult.cs
- AnnotationResource.cs
- Crypto.cs
- DataGridViewColumnConverter.cs
- QueryOutputWriter.cs
- LinkDescriptor.cs
- WebPartEditorCancelVerb.cs
- MsmqActivation.cs
- TypeReference.cs
- TreeNodeEventArgs.cs
- QuaternionRotation3D.cs
- SrgsToken.cs
- NetStream.cs
- CompositeTypefaceMetrics.cs
- SmtpFailedRecipientException.cs
- MultipartContentParser.cs