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
- WebPartManager.cs
- PeerTransportListenAddressValidator.cs
- XmlSerializer.cs
- DataTableReaderListener.cs
- AsynchronousChannelMergeEnumerator.cs
- SafeNativeMethods.cs
- TraceListeners.cs
- EntityViewContainer.cs
- CodeExpressionStatement.cs
- InsufficientMemoryException.cs
- FolderBrowserDialog.cs
- Stack.cs
- RequestCache.cs
- KnownTypesHelper.cs
- ValidationHelper.cs
- QueryableFilterRepeater.cs
- SQLGuid.cs
- EventEntry.cs
- RecipientServiceModelSecurityTokenRequirement.cs
- HttpPostedFile.cs
- SerializationInfo.cs
- SqlRowUpdatedEvent.cs
- CodeThrowExceptionStatement.cs
- MediaCommands.cs
- ToolbarAUtomationPeer.cs
- NameTable.cs
- CheckBoxFlatAdapter.cs
- RegexCompiler.cs
- ChooseAction.cs
- NGCPageContentSerializerAsync.cs
- StylusDownEventArgs.cs
- DrawingCollection.cs
- ConfigurationStrings.cs
- MultiBinding.cs
- ExpressionNode.cs
- _TLSstream.cs
- ContentTextAutomationPeer.cs
- ContextMarshalException.cs
- ToolStripSplitButton.cs
- XmlHierarchicalDataSourceView.cs
- TagPrefixInfo.cs
- CultureTableRecord.cs
- MemoryMappedFileSecurity.cs
- ObjectListCommandEventArgs.cs
- SessionStateContainer.cs
- XmlDictionaryWriter.cs
- FillErrorEventArgs.cs
- RichTextBox.cs
- SqlError.cs
- StandardBindingReliableSessionElement.cs
- Tokenizer.cs
- TextWriterEngine.cs
- HostedElements.cs
- PermissionSetTriple.cs
- RequiredFieldValidator.cs
- BamlLocalizer.cs
- PageParser.cs
- TreeWalker.cs
- RadioButtonStandardAdapter.cs
- TypeReference.cs
- ListParaClient.cs
- UnsafeNativeMethods.cs
- prefixendpointaddressmessagefiltertable.cs
- coordinatorscratchpad.cs
- MobileRedirect.cs
- TableAutomationPeer.cs
- FieldDescriptor.cs
- HashStream.cs
- TabOrder.cs
- TableDetailsCollection.cs
- SByteConverter.cs
- ConcurrencyBehavior.cs
- IItemContainerGenerator.cs
- DesignerPainter.cs
- DbgCompiler.cs
- InvalidCommandTreeException.cs
- Brush.cs
- TimeoutValidationAttribute.cs
- TextProperties.cs
- BitmapImage.cs
- System.Data.OracleClient_BID.cs
- ScrollChangedEventArgs.cs
- IssuedTokensHeader.cs
- SmtpException.cs
- ClientApiGenerator.cs
- TCPListener.cs
- PropertyGridEditorPart.cs
- WindowInteropHelper.cs
- DbConnectionPoolGroupProviderInfo.cs
- ReflectionUtil.cs
- TranslateTransform.cs
- MasterPageCodeDomTreeGenerator.cs
- SocketInformation.cs
- SecurityStateEncoder.cs
- PolyBezierSegment.cs
- FontUnit.cs
- Root.cs
- XmlArrayItemAttributes.cs
- ReadOnlyDataSourceView.cs
- XpsPackagingException.cs