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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WebException.cs
- MarkupCompiler.cs
- DesignerDataTable.cs
- EventHandlersStore.cs
- JsonCollectionDataContract.cs
- DataGridViewTextBoxEditingControl.cs
- ElementsClipboardData.cs
- ScopeCompiler.cs
- FormattedText.cs
- CookieParameter.cs
- IgnoreSection.cs
- DetailsViewInsertEventArgs.cs
- XmlComplianceUtil.cs
- SoapCommonClasses.cs
- ReferenceEqualityComparer.cs
- HierarchicalDataTemplate.cs
- FileDataSourceCache.cs
- ObjectQuery.cs
- PartialArray.cs
- MaterializeFromAtom.cs
- SecurityHeaderElementInferenceEngine.cs
- MergeFailedEvent.cs
- TrustSection.cs
- CodeNamespaceCollection.cs
- DateTimeSerializationSection.cs
- DateTimeConstantAttribute.cs
- UrlPath.cs
- EntityProviderServices.cs
- ObjectItemCollection.cs
- login.cs
- UnmanagedMemoryStreamWrapper.cs
- DelegatingHeader.cs
- FigureParagraph.cs
- BamlRecordWriter.cs
- DesignerCategoryAttribute.cs
- X509Certificate.cs
- IpcManager.cs
- InstanceHandleConflictException.cs
- DataViewListener.cs
- ConstructorArgumentAttribute.cs
- Compilation.cs
- MultipartIdentifier.cs
- CodeNamespaceCollection.cs
- SamlNameIdentifierClaimResource.cs
- ByteAnimationUsingKeyFrames.cs
- DependencyPropertyKind.cs
- Hyperlink.cs
- SafeFileMappingHandle.cs
- XmlSchemaNotation.cs
- MemoryStream.cs
- ActivationWorker.cs
- CornerRadius.cs
- LoadMessageLogger.cs
- QueryOperationResponseOfT.cs
- EntitySetDataBindingList.cs
- PrincipalPermission.cs
- ManipulationDeltaEventArgs.cs
- WebPartConnectionsCloseVerb.cs
- GroupItem.cs
- ConfigurationSectionHelper.cs
- Italic.cs
- TreeIterators.cs
- ConfigXmlElement.cs
- ClockGroup.cs
- InputLanguageManager.cs
- TemplateBamlTreeBuilder.cs
- LineServicesRun.cs
- Parser.cs
- ImageMap.cs
- EmitterCache.cs
- DataGridViewCellCollection.cs
- WindowsTitleBar.cs
- Semaphore.cs
- FunctionOverloadResolver.cs
- PolyBezierSegmentFigureLogic.cs
- ListDictionary.cs
- Misc.cs
- RegexReplacement.cs
- DataGridAddNewRow.cs
- HtmlTitle.cs
- ReplyAdapterChannelListener.cs
- MorphHelper.cs
- latinshape.cs
- Region.cs
- ListViewDeletedEventArgs.cs
- MatrixAnimationUsingPath.cs
- XmlHierarchyData.cs
- ApplicationSecurityManager.cs
- SiteMapSection.cs
- SimpleFileLog.cs
- SqlUtil.cs
- BasicCommandTreeVisitor.cs
- ServiceModelConfigurationSection.cs
- Cursors.cs
- PerfCounterSection.cs
- Style.cs
- Baml6ConstructorInfo.cs
- ComponentResourceKeyConverter.cs
- SimpleTableProvider.cs
- ConstraintStruct.cs