Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / QueryRewriting / RoleBoolean.cs / 1 / RoleBoolean.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Data.Common.Utils.Boolean; using System.Text; using System.Collections.Generic; using System.Data.Common.Utils; using System.Data.Mapping.ViewGeneration.CqlGeneration; using System.Data.Mapping.ViewGeneration.Utils; using System.Data.Mapping.ViewGeneration.Structures; using System.Data.Metadata.Edm; using System.Data.Entity; namespace System.Data.Mapping.ViewGeneration.QueryRewriting { using DomainBoolExpr = BoolExpr>; using DomainNotExpr = NotExpr >; using DomainTermExpr = TermExpr >; /// /// Denotes the fact that the key of the current tuple comes from a specific extent, or association role /// internal class RoleBoolean : TrueFalseLiteral { #region Constructor internal RoleBoolean(EntitySetBase extent) { m_metadataItem = extent; } internal RoleBoolean(AssociationSetEnd end) { m_metadataItem = end; } #endregion #region Fields private MetadataItem m_metadataItem; #endregion #region BoolLiteral members internal override StringBuilder AsCql(StringBuilder builder, string blockAlias, bool canSkipIsNotNull) { ToCompactString(builder); builder.Append("("); builder.Append(blockAlias); builder.Append(")"); return builder; } internal override StringBuilder AsUserString(StringBuilder builder, string blockAlias, bool canSkipIsNotNull) { AssociationSetEnd end = m_metadataItem as AssociationSetEnd; if (end != null) { builder.Append(Strings.ViewGen_AssociationSet_AsUserString(blockAlias, end.Name, end.ParentAssociationSet)); } else { builder.Append(Strings.ViewGen_EntitySet_AsUserString(blockAlias, m_metadataItem.ToString())); } return builder; } internal override StringBuilder AsNegatedUserString(StringBuilder builder, string blockAlias, bool canSkipIsNotNull) { AssociationSetEnd end = m_metadataItem as AssociationSetEnd; if (end != null) { builder.Append(Strings.ViewGen_AssociationSet_AsUserString_Negated(blockAlias, end.Name, end.ParentAssociationSet)); } else { builder.Append(Strings.ViewGen_EntitySet_AsUserString_Negated(blockAlias, m_metadataItem.ToString())); } return builder; } internal override void GetRequiredSlots(MemberPathMapBase projectedSlotMap, bool[] requiredSlots) { throw new NotImplementedException(); } protected override bool IsEqualTo(BoolLiteral right) { RoleBoolean rightBoolean = right as RoleBoolean; if (rightBoolean == null) { return false; } return m_metadataItem == rightBoolean.m_metadataItem; } protected override int GetHash() { return m_metadataItem.GetHashCode(); } // effects: See BoolExpression.RemapBool internal override BoolLiteral RemapBool(Dictionaryremap) { return this; } internal override bool CheckRepInvariant() { return true; } #endregion #region Other Methods internal override void ToCompactString(StringBuilder builder) { AssociationSetEnd end = m_metadataItem as AssociationSetEnd; if (end != null) { builder.Append("InEnd:" + end.ParentAssociationSet + "_" + end.Name); } else { builder.Append("InSet:" + m_metadataItem.ToString()); } } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Data.Common.Utils.Boolean; using System.Text; using System.Collections.Generic; using System.Data.Common.Utils; using System.Data.Mapping.ViewGeneration.CqlGeneration; using System.Data.Mapping.ViewGeneration.Utils; using System.Data.Mapping.ViewGeneration.Structures; using System.Data.Metadata.Edm; using System.Data.Entity; namespace System.Data.Mapping.ViewGeneration.QueryRewriting { using DomainBoolExpr = BoolExpr>; using DomainNotExpr = NotExpr >; using DomainTermExpr = TermExpr >; /// /// Denotes the fact that the key of the current tuple comes from a specific extent, or association role /// internal class RoleBoolean : TrueFalseLiteral { #region Constructor internal RoleBoolean(EntitySetBase extent) { m_metadataItem = extent; } internal RoleBoolean(AssociationSetEnd end) { m_metadataItem = end; } #endregion #region Fields private MetadataItem m_metadataItem; #endregion #region BoolLiteral members internal override StringBuilder AsCql(StringBuilder builder, string blockAlias, bool canSkipIsNotNull) { ToCompactString(builder); builder.Append("("); builder.Append(blockAlias); builder.Append(")"); return builder; } internal override StringBuilder AsUserString(StringBuilder builder, string blockAlias, bool canSkipIsNotNull) { AssociationSetEnd end = m_metadataItem as AssociationSetEnd; if (end != null) { builder.Append(Strings.ViewGen_AssociationSet_AsUserString(blockAlias, end.Name, end.ParentAssociationSet)); } else { builder.Append(Strings.ViewGen_EntitySet_AsUserString(blockAlias, m_metadataItem.ToString())); } return builder; } internal override StringBuilder AsNegatedUserString(StringBuilder builder, string blockAlias, bool canSkipIsNotNull) { AssociationSetEnd end = m_metadataItem as AssociationSetEnd; if (end != null) { builder.Append(Strings.ViewGen_AssociationSet_AsUserString_Negated(blockAlias, end.Name, end.ParentAssociationSet)); } else { builder.Append(Strings.ViewGen_EntitySet_AsUserString_Negated(blockAlias, m_metadataItem.ToString())); } return builder; } internal override void GetRequiredSlots(MemberPathMapBase projectedSlotMap, bool[] requiredSlots) { throw new NotImplementedException(); } protected override bool IsEqualTo(BoolLiteral right) { RoleBoolean rightBoolean = right as RoleBoolean; if (rightBoolean == null) { return false; } return m_metadataItem == rightBoolean.m_metadataItem; } protected override int GetHash() { return m_metadataItem.GetHashCode(); } // effects: See BoolExpression.RemapBool internal override BoolLiteral RemapBool(Dictionaryremap) { return this; } internal override bool CheckRepInvariant() { return true; } #endregion #region Other Methods internal override void ToCompactString(StringBuilder builder) { AssociationSetEnd end = m_metadataItem as AssociationSetEnd; if (end != null) { builder.Append("InEnd:" + end.ParentAssociationSet + "_" + end.Name); } else { builder.Append("InSet:" + m_metadataItem.ToString()); } } #endregion } } // 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
- UserControlAutomationPeer.cs
- CollectionContainer.cs
- Roles.cs
- TreeViewCancelEvent.cs
- CultureInfoConverter.cs
- NullableIntMinMaxAggregationOperator.cs
- SpoolingTask.cs
- XmlAtomicValue.cs
- FontNamesConverter.cs
- SchemaDeclBase.cs
- URIFormatException.cs
- ScaleTransform3D.cs
- BidPrivateBase.cs
- SingleObjectCollection.cs
- FileSystemInfo.cs
- SoapAttributeOverrides.cs
- FormViewUpdateEventArgs.cs
- GlobalizationAssembly.cs
- DataStorage.cs
- IDispatchConstantAttribute.cs
- XPathNodeList.cs
- DataDocumentXPathNavigator.cs
- CodeParameterDeclarationExpression.cs
- JavascriptCallbackBehaviorAttribute.cs
- CapiNative.cs
- PointUtil.cs
- GPPOINT.cs
- BookmarkUndoUnit.cs
- ToolStripDropDownClosedEventArgs.cs
- Msec.cs
- TemplateBindingExpression.cs
- ToolStripTextBox.cs
- BooleanExpr.cs
- _AutoWebProxyScriptEngine.cs
- ButtonBase.cs
- StateDesigner.TransitionInfo.cs
- Solver.cs
- SoapInteropTypes.cs
- TextShapeableCharacters.cs
- util.cs
- PropertyChangingEventArgs.cs
- BamlVersionHeader.cs
- CheckBoxFlatAdapter.cs
- Win32.cs
- ClientRolePrincipal.cs
- Assign.cs
- InvokePatternIdentifiers.cs
- DesignTimeParseData.cs
- WindowsComboBox.cs
- SqlFacetAttribute.cs
- EventProperty.cs
- X509ScopedServiceCertificateElementCollection.cs
- ContentPosition.cs
- UrlEncodedParameterWriter.cs
- Invariant.cs
- PropertyIDSet.cs
- RequestCacheManager.cs
- ViewSimplifier.cs
- Listen.cs
- ContextMenuStripGroupCollection.cs
- ScopelessEnumAttribute.cs
- StateDesignerConnector.cs
- BindableTemplateBuilder.cs
- TableRowGroup.cs
- RubberbandSelector.cs
- UnsafeNativeMethods.cs
- Visitors.cs
- ScalarRestriction.cs
- EncryptedReference.cs
- DataBindingCollection.cs
- XmlSchemaAttributeGroup.cs
- ScrollItemPattern.cs
- WorkflowCommandExtensionItem.cs
- CachingParameterInspector.cs
- _OverlappedAsyncResult.cs
- NativeObjectSecurity.cs
- MouseBinding.cs
- AutomationAttributeInfo.cs
- PolicyException.cs
- SimpleBitVector32.cs
- HtmlLink.cs
- DoubleAverageAggregationOperator.cs
- DateTimeFormatInfo.cs
- MissingFieldException.cs
- FormattedTextSymbols.cs
- PathFigureCollection.cs
- ImageSource.cs
- ObjectConverter.cs
- SmtpFailedRecipientException.cs
- LocalizedNameDescriptionPair.cs
- DomNameTable.cs
- RequestQueue.cs
- Pair.cs
- NetWebProxyFinder.cs
- FormatterServices.cs
- Int16Animation.cs
- ResourceContainer.cs
- GrammarBuilderDictation.cs
- PartBasedPackageProperties.cs
- isolationinterop.cs