Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / Structures / ConstantProjectedSlot.cs / 1305376 / ConstantProjectedSlot.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 ConstantProjectedSlot : ProjectedSlot { #region Constructors // effects: Creates a slot with constant value being "value" internal ConstantProjectedSlot(Constant 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 Constant m_constant; // The actual value #endregion #region Properties // effects: Returns the value stored in this constant internal Constant 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 StringBuilder AsCql(StringBuilder builder, MemberPath outputMember, string blockAlias, int indentLevel) { return m_constant.AsCql(builder, outputMember, blockAlias); } protected override bool IsEqualTo(ProjectedSlot right) { ConstantProjectedSlot rightSlot = right as ConstantProjectedSlot; if (rightSlot == null) { return false; } return Constant.EqualityComparer.Equals(m_constant, rightSlot.m_constant); } protected override int GetHash() { return Constant.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 ConstantProjectedSlot : ProjectedSlot { #region Constructors // effects: Creates a slot with constant value being "value" internal ConstantProjectedSlot(Constant 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 Constant m_constant; // The actual value #endregion #region Properties // effects: Returns the value stored in this constant internal Constant 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 StringBuilder AsCql(StringBuilder builder, MemberPath outputMember, string blockAlias, int indentLevel) { return m_constant.AsCql(builder, outputMember, blockAlias); } protected override bool IsEqualTo(ProjectedSlot right) { ConstantProjectedSlot rightSlot = right as ConstantProjectedSlot; if (rightSlot == null) { return false; } return Constant.EqualityComparer.Equals(m_constant, rightSlot.m_constant); } protected override int GetHash() { return Constant.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
- RenderOptions.cs
- TextBox.cs
- SmtpNegotiateAuthenticationModule.cs
- FormsAuthentication.cs
- ClosureBinding.cs
- MergePropertyDescriptor.cs
- XmlUTF8TextWriter.cs
- HtmlTableRowCollection.cs
- SrgsGrammar.cs
- TraceLevelStore.cs
- COM2PropertyPageUITypeConverter.cs
- URIFormatException.cs
- SrgsElementFactory.cs
- FocusManager.cs
- StreamGeometry.cs
- SystemUdpStatistics.cs
- SafeProcessHandle.cs
- ItemsControl.cs
- NameObjectCollectionBase.cs
- DependencySource.cs
- Attributes.cs
- ApplyTemplatesAction.cs
- SecurityTokenReferenceStyle.cs
- DataServiceOperationContext.cs
- KeyInfo.cs
- WebBrowser.cs
- BinaryObjectInfo.cs
- ReaderContextStackData.cs
- Roles.cs
- ScrollProperties.cs
- TextEmbeddedObject.cs
- SoundPlayer.cs
- IItemProperties.cs
- HotSpot.cs
- OSFeature.cs
- StatusBarItemAutomationPeer.cs
- Speller.cs
- WmlLinkAdapter.cs
- Serializer.cs
- RegistrationServices.cs
- ClassData.cs
- WebServiceTypeData.cs
- HwndProxyElementProvider.cs
- SqlUtil.cs
- NGCSerializer.cs
- FilteredDataSetHelper.cs
- Registry.cs
- CallTemplateAction.cs
- ShimAsPublicXamlType.cs
- AnchoredBlock.cs
- Crc32Helper.cs
- TemplateContentLoader.cs
- ObjectManager.cs
- CursorConverter.cs
- QueryStringParameter.cs
- WebPartAddingEventArgs.cs
- SQLMoneyStorage.cs
- PropertyPathConverter.cs
- SubMenuStyle.cs
- ViewStateModeByIdAttribute.cs
- ContainerSelectorBehavior.cs
- PopupControlService.cs
- XmlSyndicationContent.cs
- FixedSOMPageConstructor.cs
- PictureBox.cs
- InkCanvasSelection.cs
- LayoutEditorPart.cs
- ProtocolProfile.cs
- XDeferredAxisSource.cs
- TabPageDesigner.cs
- ActivityDesignerHelper.cs
- PrimitiveType.cs
- StaticSiteMapProvider.cs
- XmlObjectSerializerReadContextComplex.cs
- ComponentManagerBroker.cs
- BaseCodePageEncoding.cs
- LogSwitch.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- TreeNodeBindingDepthConverter.cs
- TranslateTransform3D.cs
- MediaCommands.cs
- DataListCommandEventArgs.cs
- TagNameToTypeMapper.cs
- UIPermission.cs
- PasswordPropertyTextAttribute.cs
- SQLBytes.cs
- TiffBitmapDecoder.cs
- KnownBoxes.cs
- RequestQueryParser.cs
- Errors.cs
- TdsParser.cs
- HashMembershipCondition.cs
- HitTestParameters.cs
- SerializationStore.cs
- SelectionRangeConverter.cs
- BooleanToVisibilityConverter.cs
- WindowsProgressbar.cs
- Menu.cs
- HTMLTagNameToTypeMapper.cs
- SchemaNotation.cs