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
- ValidatedControlConverter.cs
- DocumentReference.cs
- RegexCapture.cs
- ImmComposition.cs
- ApplicationCommands.cs
- PeekCompletedEventArgs.cs
- GuidTagList.cs
- AnnotationHighlightLayer.cs
- InitializationEventAttribute.cs
- Visitors.cs
- XslUrlEditor.cs
- ClusterUtils.cs
- CodeSnippetCompileUnit.cs
- ConfigurationElement.cs
- ValidatedControlConverter.cs
- BrowserCapabilitiesCodeGenerator.cs
- MenuAdapter.cs
- DbProviderServices.cs
- AddIn.cs
- OperatingSystem.cs
- CustomAttributeSerializer.cs
- SymbolTable.cs
- webeventbuffer.cs
- NativeMethods.cs
- BaseProcessor.cs
- StaticExtension.cs
- ISFClipboardData.cs
- InheritablePropertyChangeInfo.cs
- ConversionContext.cs
- SamlAudienceRestrictionCondition.cs
- ResourcePool.cs
- CodeVariableReferenceExpression.cs
- SoapMessage.cs
- FixedSOMLineCollection.cs
- MonitorWrapper.cs
- DBSchemaTable.cs
- FieldAccessException.cs
- NativeMethods.cs
- URL.cs
- DataGridViewElement.cs
- StateFinalizationActivity.cs
- JsonClassDataContract.cs
- QueryContinueDragEventArgs.cs
- SamlEvidence.cs
- ExpressionConverter.cs
- DefaultValueAttribute.cs
- WindowsEditBox.cs
- InvalidCastException.cs
- SecurityTokenException.cs
- PublishLicense.cs
- ProjectionPathBuilder.cs
- SQLMoney.cs
- ItemDragEvent.cs
- DependentList.cs
- TreeNodeEventArgs.cs
- SparseMemoryStream.cs
- CultureInfo.cs
- ParagraphResult.cs
- RequiredFieldValidator.cs
- CryptoStream.cs
- RelationalExpressions.cs
- WebConfigurationHost.cs
- EntityCommandCompilationException.cs
- SessionSwitchEventArgs.cs
- TraceFilter.cs
- MonikerUtility.cs
- AtomServiceDocumentSerializer.cs
- FileSecurity.cs
- RepeaterCommandEventArgs.cs
- XmlCustomFormatter.cs
- ScrollBarRenderer.cs
- EnumUnknown.cs
- SqlClientPermission.cs
- _LocalDataStoreMgr.cs
- DataContext.cs
- Deflater.cs
- HtmlElementCollection.cs
- IriParsingElement.cs
- DesignTimeParseData.cs
- SQLConvert.cs
- parserscommon.cs
- ContextQuery.cs
- CornerRadiusConverter.cs
- CodeDOMUtility.cs
- ControlBindingsCollection.cs
- TrustManagerPromptUI.cs
- COM2PropertyBuilderUITypeEditor.cs
- TraceContextEventArgs.cs
- HttpHeaderCollection.cs
- BindToObject.cs
- TrackBarDesigner.cs
- StreamGeometry.cs
- DayRenderEvent.cs
- WebMessageBodyStyleHelper.cs
- SpellerHighlightLayer.cs
- RadioButton.cs
- SchemaImporterExtension.cs
- InputScope.cs
- GridViewDesigner.cs
- ExitEventArgs.cs