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
- DeclarativeCatalogPart.cs
- ASCIIEncoding.cs
- EventLogPermissionAttribute.cs
- ContentPathSegment.cs
- MembershipUser.cs
- RecipientInfo.cs
- MimeWriter.cs
- ReadOnlyDictionary.cs
- ContentElement.cs
- PassportAuthentication.cs
- RenderData.cs
- KeySpline.cs
- ToolStripControlHost.cs
- Odbc32.cs
- DataColumnMappingCollection.cs
- Partitioner.cs
- MinMaxParagraphWidth.cs
- SqlBuffer.cs
- SqlRowUpdatedEvent.cs
- ToolStripItemClickedEventArgs.cs
- SafeProcessHandle.cs
- MsmqHostedTransportConfiguration.cs
- FixedTextSelectionProcessor.cs
- ObjectTypeMapping.cs
- IDReferencePropertyAttribute.cs
- InstallerTypeAttribute.cs
- DateTimeParse.cs
- PersonalizablePropertyEntry.cs
- Configuration.cs
- WebPartCollection.cs
- OutputCacheSection.cs
- ValidationErrorInfo.cs
- ExpressionNormalizer.cs
- DocumentGridContextMenu.cs
- ContextMenuService.cs
- X509Certificate2Collection.cs
- HitTestResult.cs
- RangeValueProviderWrapper.cs
- ColumnResult.cs
- SymbolUsageManager.cs
- DataObjectPastingEventArgs.cs
- ToolStripOverflow.cs
- TimersDescriptionAttribute.cs
- MonthChangedEventArgs.cs
- PageCatalogPart.cs
- Pair.cs
- CodeDOMUtility.cs
- TextElementCollection.cs
- DataBinder.cs
- TextRange.cs
- TemplateComponentConnector.cs
- AttachedPropertyInfo.cs
- LinearGradientBrush.cs
- VersionedStream.cs
- WebHeaderCollection.cs
- MachineKeySection.cs
- HtmlButton.cs
- MeasurementDCInfo.cs
- OracleRowUpdatedEventArgs.cs
- ResXResourceReader.cs
- ImmutablePropertyDescriptorGridEntry.cs
- RegexRunner.cs
- CheckoutException.cs
- _IPv4Address.cs
- MouseEvent.cs
- ReadOnlyDictionary.cs
- LayoutEditorPart.cs
- TreeNodeSelectionProcessor.cs
- PrintDialog.cs
- HttpDictionary.cs
- CodeMethodInvokeExpression.cs
- XmlNodeList.cs
- ComplexBindingPropertiesAttribute.cs
- DrawListViewSubItemEventArgs.cs
- PointAnimationBase.cs
- IsolatedStorageFile.cs
- CaseKeyBox.xaml.cs
- HttpCacheVary.cs
- DateTimeFormatInfoScanner.cs
- AssemblyBuilderData.cs
- X509Utils.cs
- HierarchicalDataTemplate.cs
- BitConverter.cs
- WindowsListViewGroup.cs
- BitVector32.cs
- ZoneMembershipCondition.cs
- adornercollection.cs
- EntityReference.cs
- CanonicalXml.cs
- MenuItemStyleCollection.cs
- Timer.cs
- CodeNamespace.cs
- DataGrid.cs
- BookmarkEventArgs.cs
- HelpInfo.cs
- HijriCalendar.cs
- GeometryHitTestParameters.cs
- ExpressionVisitor.cs
- MenuItemStyleCollection.cs
- JumpPath.cs