Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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(Dictionary remap)
{
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(Dictionary remap)
{
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
- RectAnimation.cs
- DriveNotFoundException.cs
- GraphicsContext.cs
- SecurityTokenProvider.cs
- DeferredRunTextReference.cs
- CaseStatementSlot.cs
- MobileControl.cs
- ParameterToken.cs
- RepeaterItem.cs
- EntityClassGenerator.cs
- Viewport3DVisual.cs
- StringArrayConverter.cs
- FlowDocumentPaginator.cs
- Mappings.cs
- SelfIssuedAuthRSAPKCS1SignatureDeformatter.cs
- AssemblySettingAttributes.cs
- TypeToArgumentTypeConverter.cs
- SqlParameter.cs
- OleDbReferenceCollection.cs
- FixedPage.cs
- ReachSerializationCacheItems.cs
- RowBinding.cs
- TypeUsage.cs
- FormViewCommandEventArgs.cs
- Int32Rect.cs
- PartitionerStatic.cs
- CssClassPropertyAttribute.cs
- OpenFileDialog.cs
- EventsTab.cs
- RichTextBoxConstants.cs
- WebBrowserProgressChangedEventHandler.cs
- XmlStreamNodeWriter.cs
- WindowsStatic.cs
- ProcessRequestArgs.cs
- EventListener.cs
- IgnoreFileBuildProvider.cs
- RadioButtonAutomationPeer.cs
- Literal.cs
- Filter.cs
- TextEditorCharacters.cs
- ImportOptions.cs
- SqlMethodCallConverter.cs
- RemotingSurrogateSelector.cs
- DataGridViewBindingCompleteEventArgs.cs
- SamlAttribute.cs
- ErasingStroke.cs
- WrappedIUnknown.cs
- BitmapDownload.cs
- SqlBooleanMismatchVisitor.cs
- OrderedDictionary.cs
- RecognizedWordUnit.cs
- StoreAnnotationsMap.cs
- SplitterPanel.cs
- Calendar.cs
- WmfPlaceableFileHeader.cs
- GridViewRow.cs
- TextEffectCollection.cs
- TagMapCollection.cs
- SpecularMaterial.cs
- AttributeQuery.cs
- ToolStripItemImageRenderEventArgs.cs
- XmlILStorageConverter.cs
- ListBoxDesigner.cs
- SizeAnimationClockResource.cs
- ConstraintCollection.cs
- StylusDownEventArgs.cs
- CallTemplateAction.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- StateMachineHelpers.cs
- ServiceModelPerformanceCounters.cs
- WebDisplayNameAttribute.cs
- FreeFormPanel.cs
- DynamicValidatorEventArgs.cs
- DataTableExtensions.cs
- SqlWebEventProvider.cs
- Models.cs
- CompilationLock.cs
- Point3DCollectionConverter.cs
- OutputCacheSection.cs
- DeclarativeCatalogPart.cs
- FastEncoder.cs
- _CommandStream.cs
- MessageLogger.cs
- _NtlmClient.cs
- ArcSegment.cs
- DataPager.cs
- ValidationErrorInfo.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- SqlConnection.cs
- BuilderInfo.cs
- SrgsText.cs
- GlyphTypeface.cs
- ProviderUtil.cs
- HtmlElementEventArgs.cs
- InheritanceAttribute.cs
- BinaryFormatterWriter.cs
- EncryptedKeyIdentifierClause.cs
- EndpointIdentityExtension.cs
- EventMetadata.cs
- AbandonedMutexException.cs