Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Common / Utils / Boolean / Literal.cs / 1 / 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
- RoutedPropertyChangedEventArgs.cs
- InteropTrackingRecord.cs
- _DisconnectOverlappedAsyncResult.cs
- ContentType.cs
- ClonableStack.cs
- RefreshPropertiesAttribute.cs
- HotCommands.cs
- MenuItem.cs
- SoapMessage.cs
- EpmSyndicationContentSerializer.cs
- RangeValuePatternIdentifiers.cs
- DefaultBindingPropertyAttribute.cs
- TemplatePagerField.cs
- Stylesheet.cs
- EncodingDataItem.cs
- OdbcConnectionHandle.cs
- ImageListImage.cs
- CachingHintValidation.cs
- PropertyEmitterBase.cs
- PageThemeParser.cs
- TraceLevelHelper.cs
- DefaultHttpHandler.cs
- NonVisualControlAttribute.cs
- RandomNumberGenerator.cs
- VisualTransition.cs
- UInt16Converter.cs
- WindowsHyperlink.cs
- GeometryCombineModeValidation.cs
- Vector3DIndependentAnimationStorage.cs
- XmlSequenceWriter.cs
- EdmScalarPropertyAttribute.cs
- RootAction.cs
- ServicesUtilities.cs
- XmlElementAttributes.cs
- XmlNotation.cs
- RC2.cs
- Win32.cs
- RootCodeDomSerializer.cs
- StrokeNodeData.cs
- ClientRuntimeConfig.cs
- DllNotFoundException.cs
- FieldTemplateFactory.cs
- WebBrowsableAttribute.cs
- EnumerableCollectionView.cs
- PageCodeDomTreeGenerator.cs
- TextComposition.cs
- PropertyDescriptorComparer.cs
- TypeBuilderInstantiation.cs
- XsdDateTime.cs
- UpDownEvent.cs
- XmlObjectSerializerReadContext.cs
- CmsInterop.cs
- SqlTransaction.cs
- HelloMessage11.cs
- XamlValidatingReader.cs
- SymmetricAlgorithm.cs
- RichTextBoxConstants.cs
- EventRouteFactory.cs
- HighlightComponent.cs
- XmlSchemaException.cs
- DBParameter.cs
- GridViewCommandEventArgs.cs
- CodeBinaryOperatorExpression.cs
- ThemeableAttribute.cs
- GetTokenRequest.cs
- EFDataModelProvider.cs
- FieldBuilder.cs
- StylusCollection.cs
- ResolveNameEventArgs.cs
- CapabilitiesUse.cs
- CachingHintValidation.cs
- LogLogRecord.cs
- TypedAsyncResult.cs
- Variant.cs
- HttpException.cs
- NullableIntSumAggregationOperator.cs
- GetLedgerRequest.cs
- XPathEmptyIterator.cs
- QuaternionAnimationBase.cs
- __Filters.cs
- WaitHandle.cs
- SiteMapPath.cs
- WaitHandle.cs
- securitycriticaldataformultiplegetandset.cs
- Padding.cs
- WebPartChrome.cs
- OrthographicCamera.cs
- ControlBindingsCollection.cs
- DataBoundControlAdapter.cs
- StorageFunctionMapping.cs
- RecognizerBase.cs
- LayoutExceptionEventArgs.cs
- PropertyEntry.cs
- PackWebResponse.cs
- Control.cs
- EntityExpressionVisitor.cs
- CalendarDayButton.cs
- SelectorItemAutomationPeer.cs
- InplaceBitmapMetadataWriter.cs
- RepeaterDesigner.cs