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
- AuthenticatingEventArgs.cs
- ItemCheckEvent.cs
- WebServiceErrorEvent.cs
- RotateTransform3D.cs
- GetLastErrorDetailsRequest.cs
- ListControlDataBindingHandler.cs
- GeneralTransformGroup.cs
- WaitHandle.cs
- SetStateDesigner.cs
- ConnectionConsumerAttribute.cs
- ProviderMetadata.cs
- ResourceReader.cs
- XmlSchemaException.cs
- TimeSpanValidatorAttribute.cs
- SpellerError.cs
- Main.cs
- AsynchronousChannel.cs
- ObjectNavigationPropertyMapping.cs
- TextTreeRootNode.cs
- WindowsScrollBarBits.cs
- WebPartZoneCollection.cs
- ArrangedElementCollection.cs
- Ray3DHitTestResult.cs
- FramingEncoders.cs
- UICuesEvent.cs
- CustomBindingElement.cs
- SHA1CryptoServiceProvider.cs
- MailWebEventProvider.cs
- ActiveXHelper.cs
- InternalTransaction.cs
- ReceiveReply.cs
- CharConverter.cs
- RegexRunnerFactory.cs
- WCFBuildProvider.cs
- NetPeerTcpBindingElement.cs
- storepermission.cs
- _FtpControlStream.cs
- DbProviderServices.cs
- HGlobalSafeHandle.cs
- BoundColumn.cs
- ColorConvertedBitmap.cs
- AuthenticationException.cs
- GACIdentityPermission.cs
- CriticalExceptions.cs
- BuildProviderAppliesToAttribute.cs
- PathSegmentCollection.cs
- WebConvert.cs
- CapabilitiesUse.cs
- TemplateAction.cs
- CustomWebEventKey.cs
- XmlBindingWorker.cs
- TreeNodeClickEventArgs.cs
- LinkAreaEditor.cs
- CatalogZoneBase.cs
- SafeFindHandle.cs
- BehaviorEditorPart.cs
- milexports.cs
- ToolStripComboBox.cs
- FormViewPageEventArgs.cs
- UrlMappingCollection.cs
- TerminatorSinks.cs
- MdiWindowListItemConverter.cs
- RoutingChannelExtension.cs
- CompareValidator.cs
- SafeNativeMethods.cs
- FrameworkContentElement.cs
- Version.cs
- TransformValueSerializer.cs
- EncodingTable.cs
- TransformProviderWrapper.cs
- XmlSchemaSimpleContentExtension.cs
- Control.cs
- DbInsertCommandTree.cs
- QuotedPrintableStream.cs
- GradientBrush.cs
- XsltConvert.cs
- NativeMethods.cs
- Literal.cs
- BaseValidator.cs
- MiniCustomAttributeInfo.cs
- QilVisitor.cs
- DbException.cs
- XmlElement.cs
- Listbox.cs
- LoginName.cs
- CngProvider.cs
- WebConfigurationFileMap.cs
- GeneralTransformGroup.cs
- TTSEvent.cs
- PropertyPathConverter.cs
- DataGridItem.cs
- MessageQueueEnumerator.cs
- SqlProviderServices.cs
- TearOffProxy.cs
- SliderAutomationPeer.cs
- Int32Collection.cs
- WorkflowApplication.cs
- WhitespaceRuleLookup.cs
- Faults.cs
- TextSelectionHelper.cs