Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / Structures / ConstantSlot.cs / 1 / ConstantSlot.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//---------------------------------------------------------------------
using System.Data.Mapping.ViewGeneration.CqlGeneration;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
namespace System.Data.Mapping.ViewGeneration.Structures {
// A constant that can be projected in a cell query
internal class ConstantSlot : ProjectedSlot {
#region Constructors
// effects: Creates a slot with constant value being "value"
internal ConstantSlot(CellConstant value) {
Debug.Assert(value != null);
m_constant = value;
Debug.Assert(value.IsNotNull() == false, "Cannot store NotNull in a slot - NotNull is only for conditions");
}
#endregion
#region Fields
private CellConstant m_constant; // The actual value
#endregion
#region Properties
// effects: Returns the value stored in this constant
internal CellConstant CellConstant {
get {return m_constant;}
}
#endregion
#region ProjectedSlot Members
internal override ProjectedSlot MakeAliasedSlot(CqlBlock block, MemberPath memberPath, int slotNum) {
return this; // Nothing to create
}
internal override ProjectedSlot RemapSlot(Dictionary remap) {
return this; // No remapping needed
}
internal override StringBuilder AsCql(StringBuilder builder, MemberPath outputMember,
string blockAlias, int indentLevel) {
return m_constant.AsCql(builder, outputMember, blockAlias);
}
protected override bool IsEqualTo(ProjectedSlot right) {
ConstantSlot rightSlot = right as ConstantSlot;
if (rightSlot == null) {
return false;
}
return CellConstant.EqualityComparer.Equals(m_constant, rightSlot.m_constant);
}
protected override int GetHash() {
return CellConstant.EqualityComparer.GetHashCode(m_constant);
}
#endregion
internal override void ToCompactString(StringBuilder builder) {
m_constant.ToCompactString(builder);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//---------------------------------------------------------------------
using System.Data.Mapping.ViewGeneration.CqlGeneration;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
namespace System.Data.Mapping.ViewGeneration.Structures {
// A constant that can be projected in a cell query
internal class ConstantSlot : ProjectedSlot {
#region Constructors
// effects: Creates a slot with constant value being "value"
internal ConstantSlot(CellConstant value) {
Debug.Assert(value != null);
m_constant = value;
Debug.Assert(value.IsNotNull() == false, "Cannot store NotNull in a slot - NotNull is only for conditions");
}
#endregion
#region Fields
private CellConstant m_constant; // The actual value
#endregion
#region Properties
// effects: Returns the value stored in this constant
internal CellConstant CellConstant {
get {return m_constant;}
}
#endregion
#region ProjectedSlot Members
internal override ProjectedSlot MakeAliasedSlot(CqlBlock block, MemberPath memberPath, int slotNum) {
return this; // Nothing to create
}
internal override ProjectedSlot RemapSlot(Dictionary remap) {
return this; // No remapping needed
}
internal override StringBuilder AsCql(StringBuilder builder, MemberPath outputMember,
string blockAlias, int indentLevel) {
return m_constant.AsCql(builder, outputMember, blockAlias);
}
protected override bool IsEqualTo(ProjectedSlot right) {
ConstantSlot rightSlot = right as ConstantSlot;
if (rightSlot == null) {
return false;
}
return CellConstant.EqualityComparer.Equals(m_constant, rightSlot.m_constant);
}
protected override int GetHash() {
return CellConstant.EqualityComparer.GetHashCode(m_constant);
}
#endregion
internal override void ToCompactString(StringBuilder builder) {
m_constant.ToCompactString(builder);
}
}
}
// 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
- RepeaterDataBoundAdapter.cs
- HttpDictionary.cs
- FieldNameLookup.cs
- WebContext.cs
- TextServicesLoader.cs
- XamlWriter.cs
- NamespaceQuery.cs
- DataServiceHost.cs
- Domain.cs
- Point3DValueSerializer.cs
- NestedContainer.cs
- CodeEventReferenceExpression.cs
- DocumentDesigner.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- SqlDependencyListener.cs
- OdbcDataReader.cs
- RepeatButton.cs
- DBDataPermission.cs
- RewritingSimplifier.cs
- Point4D.cs
- ParallelDesigner.xaml.cs
- Transform.cs
- CheckedListBox.cs
- DeriveBytes.cs
- XsltException.cs
- FactoryGenerator.cs
- _CacheStreams.cs
- SystemIPv4InterfaceProperties.cs
- ResourceWriter.cs
- CompiledRegexRunner.cs
- HelloOperationCD1AsyncResult.cs
- TriggerActionCollection.cs
- X509InitiatorCertificateServiceElement.cs
- RequiredAttributeAttribute.cs
- InputEventArgs.cs
- KnownTypeAttribute.cs
- RegistryKey.cs
- BooleanSwitch.cs
- SimpleFileLog.cs
- ProviderConnectionPoint.cs
- CompleteWizardStep.cs
- MetadataSource.cs
- SizeAnimationClockResource.cs
- EntityWrapper.cs
- UserControlBuildProvider.cs
- SystemSounds.cs
- SystemThemeKey.cs
- ImageAutomationPeer.cs
- CategoryGridEntry.cs
- DefaultProxySection.cs
- MetadataHelper.cs
- SqlTransaction.cs
- ToolStripProgressBar.cs
- BookmarkList.cs
- ViewSimplifier.cs
- RenderDataDrawingContext.cs
- XmlElementElementCollection.cs
- EmptyQuery.cs
- ItemList.cs
- ReversePositionQuery.cs
- XmlILAnnotation.cs
- BaseDataBoundControl.cs
- OLEDB_Enum.cs
- SecUtil.cs
- ThreadInterruptedException.cs
- BinaryObjectReader.cs
- ParameterCollection.cs
- Utils.cs
- Win32MouseDevice.cs
- RuntimeVariablesExpression.cs
- RegexTree.cs
- ParseNumbers.cs
- XmlAnyAttributeAttribute.cs
- NotifyParentPropertyAttribute.cs
- ValueTypePropertyReference.cs
- TraceUtils.cs
- KerberosTicketHashIdentifierClause.cs
- ResourceSet.cs
- GenericEnumConverter.cs
- Mapping.cs
- AxHostDesigner.cs
- SchemaEntity.cs
- OptimizedTemplateContent.cs
- StringSorter.cs
- Attribute.cs
- ExpressionDumper.cs
- ProviderMetadataCachedInformation.cs
- HostingPreferredMapPath.cs
- PermissionSetTriple.cs
- StructuralType.cs
- HttpContext.cs
- CodeMemberProperty.cs
- FileIOPermission.cs
- indexingfiltermarshaler.cs
- MenuScrollingVisibilityConverter.cs
- OleDbPropertySetGuid.cs
- DataGridViewButtonColumn.cs
- PTProvider.cs
- GreenMethods.cs
- RegexTree.cs