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
- TrackingParameters.cs
- ObjectNotFoundException.cs
- OdbcFactory.cs
- IriParsingElement.cs
- SqlFileStream.cs
- WebPartHelpVerb.cs
- WebHttpBindingCollectionElement.cs
- QilGenerator.cs
- DoWorkEventArgs.cs
- FileAuthorizationModule.cs
- SafeFindHandle.cs
- SpecularMaterial.cs
- CustomCategoryAttribute.cs
- MimeObjectFactory.cs
- Evaluator.cs
- PixelShader.cs
- ImportDesigner.xaml.cs
- UnmanagedBitmapWrapper.cs
- DrawingState.cs
- FileLevelControlBuilderAttribute.cs
- GroupJoinQueryOperator.cs
- ScrollBarAutomationPeer.cs
- QuaternionRotation3D.cs
- HotSpotCollection.cs
- COMException.cs
- CharEnumerator.cs
- shaperfactoryquerycacheentry.cs
- NavigationService.cs
- DataMemberAttribute.cs
- ToolZone.cs
- ZipIOBlockManager.cs
- StringConcat.cs
- TableLayoutPanelDesigner.cs
- CodeAssignStatement.cs
- TableLayout.cs
- SystemPens.cs
- XmlAnyElementAttributes.cs
- AnnotationAdorner.cs
- PriorityItem.cs
- PlatformNotSupportedException.cs
- LinkUtilities.cs
- ZipFileInfoCollection.cs
- StreamSecurityUpgradeAcceptorBase.cs
- IdentitySection.cs
- DataGridViewTextBoxEditingControl.cs
- FormsAuthenticationUserCollection.cs
- ViewGenerator.cs
- ColumnPropertiesGroup.cs
- SerializationInfoEnumerator.cs
- ImageAnimator.cs
- XamlRtfConverter.cs
- ConfigurationElement.cs
- _ListenerRequestStream.cs
- HealthMonitoringSection.cs
- HtmlWindowCollection.cs
- BoundingRectTracker.cs
- ImageListStreamer.cs
- FastEncoder.cs
- DataObjectEventArgs.cs
- CommandManager.cs
- CleanUpVirtualizedItemEventArgs.cs
- UndirectedGraph.cs
- StatusBarPanel.cs
- AlternateView.cs
- RequestNavigateEventArgs.cs
- ResourceProviderFactory.cs
- NativeCppClassAttribute.cs
- Stackframe.cs
- EncoderFallback.cs
- X509Certificate.cs
- ErasingStroke.cs
- SchemaInfo.cs
- SoapAttributeOverrides.cs
- StreamGeometryContext.cs
- LinkLabelLinkClickedEvent.cs
- HideDisabledControlAdapter.cs
- AnimationClock.cs
- SqlProviderServices.cs
- System.Data.OracleClient_BID.cs
- ThreadAttributes.cs
- StaticResourceExtension.cs
- SHA256CryptoServiceProvider.cs
- StretchValidation.cs
- TreeViewEvent.cs
- MdbDataFileEditor.cs
- TaskExtensions.cs
- TargetException.cs
- ReferencedAssembly.cs
- TimelineGroup.cs
- ErrorItem.cs
- PointIndependentAnimationStorage.cs
- FilterFactory.cs
- MediaEntryAttribute.cs
- ItemCollection.cs
- VariableAction.cs
- AutoFocusStyle.xaml.cs
- ItemCollection.cs
- ContractCodeDomInfo.cs
- BatchWriter.cs
- DataTableMappingCollection.cs