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
- DataGridViewCellValidatingEventArgs.cs
- ActiveXContainer.cs
- login.cs
- DataGridViewCellStyleConverter.cs
- ResolveMatchesMessage11.cs
- BasicBrowserDialog.cs
- HuffModule.cs
- AppDomainEvidenceFactory.cs
- ObjectQueryProvider.cs
- TypeElement.cs
- ProcessHostConfigUtils.cs
- TextChangedEventArgs.cs
- UnsafeNativeMethods.cs
- ReflectionPermission.cs
- ActivityValidationServices.cs
- ControlValuePropertyAttribute.cs
- PropertyNames.cs
- RefreshPropertiesAttribute.cs
- WindowsToolbar.cs
- FlowDocumentPaginator.cs
- Version.cs
- RemotingException.cs
- NativeActivity.cs
- HtmlInputCheckBox.cs
- ConfigurationException.cs
- EventProviderWriter.cs
- _AutoWebProxyScriptWrapper.cs
- NamespaceDecl.cs
- CircleHotSpot.cs
- HMACRIPEMD160.cs
- DragEventArgs.cs
- WebPartDisplayModeCancelEventArgs.cs
- RotationValidation.cs
- RSAOAEPKeyExchangeDeformatter.cs
- HttpListenerPrefixCollection.cs
- ShaderRenderModeValidation.cs
- DataPointer.cs
- MarkupCompiler.cs
- CodeTypeReference.cs
- Label.cs
- Attribute.cs
- LineGeometry.cs
- XmlLanguageConverter.cs
- DataGridViewColumnTypePicker.cs
- WebPartEditorApplyVerb.cs
- IPAddress.cs
- dtdvalidator.cs
- ApplicationSettingsBase.cs
- FontSourceCollection.cs
- EdmRelationshipRoleAttribute.cs
- FixedNode.cs
- OdbcPermission.cs
- VarRefManager.cs
- BinaryCommonClasses.cs
- CqlParserHelpers.cs
- HttpHandlerAction.cs
- ToolStripDropDownButton.cs
- HeaderPanel.cs
- MethodSet.cs
- MultiView.cs
- ByteStorage.cs
- SecuritySessionClientSettings.cs
- CodeDesigner.cs
- CompositeDataBoundControl.cs
- TextTreePropertyUndoUnit.cs
- SystemWebCachingSectionGroup.cs
- IDReferencePropertyAttribute.cs
- CompilerLocalReference.cs
- EntityDataSourceColumn.cs
- InputBindingCollection.cs
- RadioButton.cs
- StateMachineSubscription.cs
- PromptBuilder.cs
- CodeObject.cs
- ResizeBehavior.cs
- StylusPointPropertyId.cs
- UdpAnnouncementEndpoint.cs
- ListControlBoundActionList.cs
- NamedPipeTransportSecurity.cs
- AbandonedMutexException.cs
- RuntimeVariableList.cs
- IItemContainerGenerator.cs
- AsyncResult.cs
- AndCondition.cs
- ResourceBinder.cs
- NameSpaceExtractor.cs
- FixedBufferAttribute.cs
- NullRuntimeConfig.cs
- ScriptResourceInfo.cs
- XamlGridLengthSerializer.cs
- SmiGettersStream.cs
- VirtualizingPanel.cs
- sqlnorm.cs
- ListControlConvertEventArgs.cs
- TextDecorationCollection.cs
- ToolStripStatusLabel.cs
- QuestionEventArgs.cs
- ColorTransformHelper.cs
- PageFunction.cs
- XmlSchemaRedefine.cs