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
- SqlServer2KCompatibilityCheck.cs
- ObjectStateFormatter.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- Clock.cs
- XmlSchemas.cs
- OrderingQueryOperator.cs
- LicenseException.cs
- ToolStripMenuItemDesigner.cs
- PackagePartCollection.cs
- ModelFunction.cs
- SqlParameterizer.cs
- PropertyMapper.cs
- XmlSchemaObjectTable.cs
- FontSource.cs
- IPPacketInformation.cs
- Attributes.cs
- StylusPointCollection.cs
- ListBindingHelper.cs
- WindowsFont.cs
- HttpPostLocalhostServerProtocol.cs
- ExpandCollapseIsCheckedConverter.cs
- UidManager.cs
- TextAction.cs
- AsyncOperation.cs
- MyContact.cs
- HostUtils.cs
- UnmanagedBitmapWrapper.cs
- EventWaitHandleSecurity.cs
- GridEntry.cs
- LinkButton.cs
- StatusBarItemAutomationPeer.cs
- NegotiateStream.cs
- arabicshape.cs
- ScriptResourceAttribute.cs
- TaskFormBase.cs
- ToolStripDropDown.cs
- SqlMetaData.cs
- HierarchicalDataTemplate.cs
- NextPreviousPagerField.cs
- WebServiceTypeData.cs
- AsyncCallback.cs
- RoleProviderPrincipal.cs
- BinaryHeap.cs
- DependencyObjectProvider.cs
- SequentialActivityDesigner.cs
- IssuanceLicense.cs
- HwndTarget.cs
- LambdaCompiler.Address.cs
- NativeMethods.cs
- UpdateDelegates.Generated.cs
- Span.cs
- FunctionNode.cs
- LinkGrep.cs
- COM2ExtendedTypeConverter.cs
- Table.cs
- _RequestLifetimeSetter.cs
- _SslStream.cs
- SystemWebCachingSectionGroup.cs
- RawTextInputReport.cs
- Separator.cs
- DataGridViewRowConverter.cs
- LostFocusEventManager.cs
- SiteMap.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- MaskDescriptor.cs
- ExpressionNode.cs
- StrongNameKeyPair.cs
- BinaryObjectReader.cs
- KnownBoxes.cs
- BypassElement.cs
- BitmapEffectGroup.cs
- EntityDataSourceView.cs
- DesignBindingPicker.cs
- EnvelopedPkcs7.cs
- DataViewManager.cs
- FileLogRecord.cs
- XPathAxisIterator.cs
- WebPartTransformerAttribute.cs
- Point4DConverter.cs
- GridViewUpdatedEventArgs.cs
- EndpointNameMessageFilter.cs
- SqlVersion.cs
- CollectionBase.cs
- ConfigurationStrings.cs
- FixedPosition.cs
- SQLInt32.cs
- RuleSettings.cs
- CommandDevice.cs
- BindingCompleteEventArgs.cs
- FormsAuthenticationEventArgs.cs
- CorrelationManager.cs
- CodeDirectoryCompiler.cs
- IPCCacheManager.cs
- PrintPreviewDialog.cs
- VirtualizingPanel.cs
- UIElement3D.cs
- CorrelationExtension.cs
- MimeTypePropertyAttribute.cs
- TraceHandler.cs
- WebPartAddingEventArgs.cs