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
- SemanticResultKey.cs
- OleServicesContext.cs
- CompiledAction.cs
- PerformanceCounterLib.cs
- XmlArrayAttribute.cs
- AttributeProviderAttribute.cs
- CompilerGeneratedAttribute.cs
- DragCompletedEventArgs.cs
- GregorianCalendar.cs
- RewritingPass.cs
- KernelTypeValidation.cs
- ListViewTableCell.cs
- BlurEffect.cs
- CdpEqualityComparer.cs
- MarkupExtensionParser.cs
- EditingCommands.cs
- SqlDataSourceCommandEventArgs.cs
- SchemaImporterExtensionElementCollection.cs
- DataGridPagerStyle.cs
- SqlStatistics.cs
- _NativeSSPI.cs
- PropertyDescriptorGridEntry.cs
- SqlConnectionFactory.cs
- SectionVisual.cs
- XsdCachingReader.cs
- DataGridViewColumnTypeEditor.cs
- ResizeGrip.cs
- precedingsibling.cs
- SoapSchemaMember.cs
- DoubleCollection.cs
- LicFileLicenseProvider.cs
- SoapEnumAttribute.cs
- DomainLiteralReader.cs
- ConnectionsZoneDesigner.cs
- NumericUpDownAccelerationCollection.cs
- SchemaCollectionPreprocessor.cs
- LinqToSqlWrapper.cs
- EdmMember.cs
- DPAPIProtectedConfigurationProvider.cs
- UIElementParaClient.cs
- WebControl.cs
- ColumnWidthChangedEvent.cs
- ServiceContractGenerationContext.cs
- DetailsViewPagerRow.cs
- DesignerDataSourceView.cs
- SqlNotificationEventArgs.cs
- _SSPISessionCache.cs
- UrlMappingsSection.cs
- PaintEvent.cs
- Type.cs
- LogicalExpressionEditor.cs
- HtmlInputHidden.cs
- PersonalizationStateQuery.cs
- SimpleRecyclingCache.cs
- FreezableCollection.cs
- HighlightVisual.cs
- ExpressionBuilder.cs
- SystemUdpStatistics.cs
- DataServiceQuery.cs
- SymmetricKeyWrap.cs
- ListItemViewControl.cs
- IDispatchConstantAttribute.cs
- SchemaImporterExtensionElement.cs
- RijndaelManaged.cs
- SqlGatherProducedAliases.cs
- SettingsAttributeDictionary.cs
- DrawingCollection.cs
- GC.cs
- BitmapEffectGeneralTransform.cs
- XhtmlTextWriter.cs
- BaseDataListActionList.cs
- UiaCoreApi.cs
- XmlSchemaDocumentation.cs
- XmlReflectionMember.cs
- UiaCoreProviderApi.cs
- TraceSwitch.cs
- ConfigurationSectionHelper.cs
- _ChunkParse.cs
- MenuCommand.cs
- CommandBindingCollection.cs
- FrameworkElementFactoryMarkupObject.cs
- SequenceFullException.cs
- Point3DCollection.cs
- ImportCatalogPart.cs
- PrintEvent.cs
- StrongNameIdentityPermission.cs
- HttpWriter.cs
- CommandDevice.cs
- LiteralControl.cs
- XmlReaderDelegator.cs
- IncrementalHitTester.cs
- FormatSettings.cs
- LinkLabelLinkClickedEvent.cs
- FileRegion.cs
- precedingquery.cs
- UniqueIdentifierService.cs
- SqlUDTStorage.cs
- DataDocumentXPathNavigator.cs
- AxisAngleRotation3D.cs
- EmbeddedMailObject.cs