Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------- // // 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
- DataGridViewRowPrePaintEventArgs.cs
- ResourceDescriptionAttribute.cs
- DispatcherObject.cs
- COM2PropertyDescriptor.cs
- SystemInfo.cs
- BmpBitmapEncoder.cs
- EdmSchemaError.cs
- WorkflowIdleElement.cs
- CodeCastExpression.cs
- PeerNearMe.cs
- AsyncContentLoadedEventArgs.cs
- FontWeights.cs
- StateBag.cs
- LinkUtilities.cs
- DictionaryManager.cs
- Int16Converter.cs
- BaseCollection.cs
- ConfigurationSection.cs
- DesignerOptionService.cs
- CodeParameterDeclarationExpressionCollection.cs
- SaveFileDialog.cs
- UIElementAutomationPeer.cs
- StringDictionaryCodeDomSerializer.cs
- EncoderParameter.cs
- HyperLinkDataBindingHandler.cs
- ExceptionRoutedEventArgs.cs
- ConfigurationValues.cs
- TreeView.cs
- ArrayList.cs
- ThicknessKeyFrameCollection.cs
- WebServiceClientProxyGenerator.cs
- ComponentResourceKeyConverter.cs
- CursorInteropHelper.cs
- X509AsymmetricSecurityKey.cs
- TdsParserStaticMethods.cs
- XmlParserContext.cs
- SecurityElement.cs
- Italic.cs
- Primitive.cs
- PathFigure.cs
- IApplicationTrustManager.cs
- LocalFileSettingsProvider.cs
- x509store.cs
- WsatServiceCertificate.cs
- InternalTypeHelper.cs
- ItemType.cs
- ReflectTypeDescriptionProvider.cs
- FilePrompt.cs
- SiteMapHierarchicalDataSourceView.cs
- securitymgrsite.cs
- OracleConnection.cs
- HeaderedItemsControl.cs
- RenderDataDrawingContext.cs
- SafeReversePInvokeHandle.cs
- RequestBringIntoViewEventArgs.cs
- PeoplePickerWrapper.cs
- XamlUtilities.cs
- InvokeMemberBinder.cs
- MsmqInputChannelListenerBase.cs
- ValidatorCompatibilityHelper.cs
- XmlDataImplementation.cs
- FileRecordSequenceCompletedAsyncResult.cs
- StatusBarAutomationPeer.cs
- Stacktrace.cs
- PngBitmapDecoder.cs
- ChannelPoolSettings.cs
- PersonalizationProviderCollection.cs
- LinqDataSourceUpdateEventArgs.cs
- PseudoWebRequest.cs
- TransformedBitmap.cs
- UiaCoreTypesApi.cs
- versioninfo.cs
- ProviderConnectionPoint.cs
- PathFigureCollection.cs
- StructureChangedEventArgs.cs
- DetailsViewInsertedEventArgs.cs
- PolicyChain.cs
- ButtonChrome.cs
- SafeNativeMethods.cs
- QueryCreatedEventArgs.cs
- CreateDataSourceDialog.cs
- CreateInstanceBinder.cs
- AudioLevelUpdatedEventArgs.cs
- TransformCollection.cs
- xmlfixedPageInfo.cs
- TextRenderer.cs
- SchemaMerger.cs
- unsafeIndexingFilterStream.cs
- FieldAccessException.cs
- EntitySetBaseCollection.cs
- ActiveXContainer.cs
- NetCodeGroup.cs
- PolyBezierSegment.cs
- AppearanceEditorPart.cs
- BinaryReader.cs
- DragEventArgs.cs
- StylusDownEventArgs.cs
- selecteditemcollection.cs
- WindowsImpersonationContext.cs
- HtmlLink.cs