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
- XsltException.cs
- ChannelSinkStacks.cs
- SecurityTokenSerializer.cs
- RelOps.cs
- ComPlusThreadInitializer.cs
- LocalizableResourceBuilder.cs
- ContextQuery.cs
- ContextQuery.cs
- Effect.cs
- DefaultProxySection.cs
- WebPartManagerInternals.cs
- EditorZoneBase.cs
- OracleConnectionString.cs
- WinEventQueueItem.cs
- TableCellCollection.cs
- DataGridViewDataErrorEventArgs.cs
- X509PeerCertificateAuthenticationElement.cs
- CodeMemberMethod.cs
- WindowsNonControl.cs
- SqlLiftIndependentRowExpressions.cs
- BinaryCommonClasses.cs
- GridPattern.cs
- HMACSHA384.cs
- SchemaInfo.cs
- ForeignKeyConstraint.cs
- StylusPointPropertyInfoDefaults.cs
- EventLogQuery.cs
- ReflectionPermission.cs
- DropShadowEffect.cs
- XmlComplianceUtil.cs
- StateRuntime.cs
- CodeIdentifier.cs
- DisplayClaim.cs
- XmlLoader.cs
- MimeParameter.cs
- NotifyCollectionChangedEventArgs.cs
- ButtonColumn.cs
- WaveHeader.cs
- SoapSchemaImporter.cs
- Point4DValueSerializer.cs
- SqlConnectionManager.cs
- Rule.cs
- RowUpdatingEventArgs.cs
- ListenerConnectionModeReader.cs
- XPathParser.cs
- SharedStream.cs
- PreProcessor.cs
- HtmlAnchor.cs
- RemoteWebConfigurationHost.cs
- BaseTemplateCodeDomTreeGenerator.cs
- ParseHttpDate.cs
- BindingEditor.xaml.cs
- Identity.cs
- DataGridColumn.cs
- OdbcInfoMessageEvent.cs
- HttpGetProtocolReflector.cs
- Utils.cs
- TemplateKeyConverter.cs
- NavigationWindow.cs
- Condition.cs
- FunctionNode.cs
- Metadata.cs
- SizeAnimationClockResource.cs
- ToolboxItemCollection.cs
- TextRange.cs
- BrushValueSerializer.cs
- SimpleHandlerFactory.cs
- Compiler.cs
- DateTimeOffsetStorage.cs
- DbMetaDataCollectionNames.cs
- XmlStreamStore.cs
- HeaderUtility.cs
- TreeViewDesigner.cs
- GeneralTransform3DCollection.cs
- TemplateGroupCollection.cs
- Serializer.cs
- ProfessionalColors.cs
- InvalidWMPVersionException.cs
- TableRow.cs
- DataSourceHelper.cs
- OneWayElement.cs
- ObjectListCommandEventArgs.cs
- WorkflowElementDialogWindow.xaml.cs
- ModelItemDictionary.cs
- SmtpLoginAuthenticationModule.cs
- EventLogPermissionEntry.cs
- PerformanceCounterPermissionAttribute.cs
- Subtract.cs
- ACL.cs
- JsonEnumDataContract.cs
- DeploymentExceptionMapper.cs
- EditorPartCollection.cs
- CodeChecksumPragma.cs
- TextTreeUndo.cs
- XPathNodeInfoAtom.cs
- HGlobalSafeHandle.cs
- EdmRelationshipRoleAttribute.cs
- ElementHostAutomationPeer.cs
- TypeTypeConverter.cs
- MethodCallTranslator.cs