Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / QueryRewriting / RoleBoolean.cs / 1305376 / 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(MemberProjectionIndex 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; } #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
- DesignBindingConverter.cs
- Sql8ConformanceChecker.cs
- PropertyCollection.cs
- BuildProviderAppliesToAttribute.cs
- ColorTranslator.cs
- DirectoryNotFoundException.cs
- DynamicResourceExtension.cs
- __FastResourceComparer.cs
- BindableTemplateBuilder.cs
- InputScope.cs
- ControlBuilder.cs
- FaultContractAttribute.cs
- XmlSchemaProviderAttribute.cs
- ResXDataNode.cs
- UITypeEditor.cs
- SqlWorkflowInstanceStoreLock.cs
- ResourceDescriptionAttribute.cs
- CommonXSendMessage.cs
- DocumentReferenceCollection.cs
- ToolBarDesigner.cs
- NameValueConfigurationCollection.cs
- FontStretchConverter.cs
- StringSorter.cs
- SctClaimSerializer.cs
- MimeTypeAttribute.cs
- webbrowsersite.cs
- LoginUtil.cs
- WSSecurityOneDotZeroSendSecurityHeader.cs
- TargetControlTypeAttribute.cs
- RoleExceptions.cs
- DataKeyCollection.cs
- BlockExpression.cs
- TreeViewItem.cs
- VariableReference.cs
- LoadWorkflowAsyncResult.cs
- HtmlElementEventArgs.cs
- StorageSetMapping.cs
- TableCell.cs
- DrawingDrawingContext.cs
- IdentityManager.cs
- TableNameAttribute.cs
- RTLAwareMessageBox.cs
- CustomAssemblyResolver.cs
- StringReader.cs
- SchemaTypeEmitter.cs
- SrgsElementList.cs
- TraceListener.cs
- XmlValidatingReaderImpl.cs
- SQLCharsStorage.cs
- ActivityXamlServices.cs
- JsonStringDataContract.cs
- CollectionView.cs
- JapaneseLunisolarCalendar.cs
- CodeVariableDeclarationStatement.cs
- SerializationStore.cs
- XmlSerializerNamespaces.cs
- MaterialCollection.cs
- GridPattern.cs
- DataView.cs
- DataGridItemEventArgs.cs
- ArrayHelper.cs
- Vector.cs
- CurrencyManager.cs
- ConnectionManagementElementCollection.cs
- cookieexception.cs
- Vector3DCollectionConverter.cs
- GifBitmapEncoder.cs
- ExpandCollapseProviderWrapper.cs
- GeneralTransform3D.cs
- JsonReaderWriterFactory.cs
- ProgressChangedEventArgs.cs
- TableLayoutPanel.cs
- ArrangedElementCollection.cs
- HttpEncoderUtility.cs
- AtomMaterializerLog.cs
- DocumentViewerBase.cs
- ClientRuntimeConfig.cs
- FloaterParagraph.cs
- DateTimeFormatInfoScanner.cs
- ToolStripMenuItem.cs
- WebColorConverter.cs
- GeneralTransform2DTo3D.cs
- AuthenticationService.cs
- RichTextBoxConstants.cs
- XmlHelper.cs
- GradientSpreadMethodValidation.cs
- ExtractCollection.cs
- JpegBitmapDecoder.cs
- ToolStripSplitStackLayout.cs
- ErrorInfoXmlDocument.cs
- NamespaceCollection.cs
- ListChangedEventArgs.cs
- SessionState.cs
- ProfileServiceManager.cs
- MSHTMLHost.cs
- SelectionHighlightInfo.cs
- SchemeSettingElementCollection.cs
- MenuItem.cs
- MetadataItem.cs
- AtomContentProperty.cs