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
- TemplateControl.cs
- TextBoxDesigner.cs
- SystemFonts.cs
- FillErrorEventArgs.cs
- SystemDiagnosticsSection.cs
- PolicyException.cs
- RepeaterItemEventArgs.cs
- OdbcError.cs
- WeakReferenceList.cs
- cache.cs
- ArglessEventHandlerProxy.cs
- StorageScalarPropertyMapping.cs
- Visual3D.cs
- Encoder.cs
- TabControl.cs
- WindowsScrollBarBits.cs
- TableLayoutPanelCellPosition.cs
- DispatchWrapper.cs
- FolderBrowserDialogDesigner.cs
- XmlElementAttributes.cs
- SafeCryptContextHandle.cs
- CustomAttributeFormatException.cs
- FilterException.cs
- SqlFacetAttribute.cs
- MenuCommand.cs
- SerializationFieldInfo.cs
- DesignerAutoFormat.cs
- WebPartAuthorizationEventArgs.cs
- MetadataArtifactLoaderResource.cs
- SmtpDateTime.cs
- NeutralResourcesLanguageAttribute.cs
- TextSyndicationContentKindHelper.cs
- StateChangeEvent.cs
- CompilerInfo.cs
- X509ServiceCertificateAuthentication.cs
- CatalogPart.cs
- SettingsSection.cs
- ChangeProcessor.cs
- FragmentNavigationEventArgs.cs
- EntityReference.cs
- URIFormatException.cs
- LinkButton.cs
- MultiByteCodec.cs
- DockPatternIdentifiers.cs
- LinearKeyFrames.cs
- EntityDataSourceDesigner.cs
- HandledMouseEvent.cs
- PropertyConverter.cs
- BooleanConverter.cs
- OleDbWrapper.cs
- DataGridPreparingCellForEditEventArgs.cs
- WebCategoryAttribute.cs
- DateTimeFormatInfoScanner.cs
- DrawingAttributeSerializer.cs
- NewExpression.cs
- DefaultSection.cs
- DesignTimeTemplateParser.cs
- FormsAuthenticationModule.cs
- RightsManagementPermission.cs
- CssTextWriter.cs
- KeyGestureValueSerializer.cs
- RowToFieldTransformer.cs
- EnumConverter.cs
- SqlConnectionStringBuilder.cs
- RuleElement.cs
- GenericWebPart.cs
- DataGridViewComboBoxColumnDesigner.cs
- _NegotiateClient.cs
- AnnotationAdorner.cs
- Attribute.cs
- LinkButton.cs
- FlowDocumentPage.cs
- DateTimeConstantAttribute.cs
- DataPagerCommandEventArgs.cs
- FormClosedEvent.cs
- MediaScriptCommandRoutedEventArgs.cs
- HandlerFactoryWrapper.cs
- MetafileHeader.cs
- DataGridViewTextBoxCell.cs
- BaseTemplateParser.cs
- CaseExpr.cs
- _BaseOverlappedAsyncResult.cs
- EntitySqlQueryCacheKey.cs
- TouchesOverProperty.cs
- TableCell.cs
- FixedSOMGroup.cs
- SignedXmlDebugLog.cs
- FrameworkRichTextComposition.cs
- StringReader.cs
- StringAttributeCollection.cs
- TextParagraph.cs
- OracleLob.cs
- LineBreakRecord.cs
- mediaeventshelper.cs
- DataGrid.cs
- TypeUtil.cs
- RowType.cs
- XPathSelfQuery.cs
- HtmlTernaryTree.cs
- XmlSchemaAppInfo.cs