Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / CqlGeneration / BooleanProjectedSlot.cs / 1305376 / BooleanProjectedSlot.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Data.Mapping.ViewGeneration.Structures; using System.Text; using System.Diagnostics; using System.Data.Common.Utils; namespace System.Data.Mapping.ViewGeneration.CqlGeneration { // This class represents slots for the boolean variables, e.g., _from0, // _from1, etc internal class BooleanProjectedSlot : ProjectedSlot { #region Constructor // effects: Creates a boolean slot for expression that comes from // originalCellNum, i.e., the value of the slot is "expr" and the // name is "_from", e.g., _from2 internal BooleanProjectedSlot(BoolExpression expr, CqlIdentifiers identifiers, int originalCellNum) { m_expr = expr; m_originalCell = new CellIdBoolean(identifiers, originalCellNum); CellIdBoolean boolExpr = expr.AsLiteral as CellIdBoolean; Debug.Assert(boolExpr == null || BoolLiteral.EqualityComparer.Equals(boolExpr, m_originalCell), "Cellid boolean for the slot and cell number disagree"); } #endregion #region Fields private BoolExpression m_expr; // The actual value of the slot - // could be CellIdBoolean! // A boolean corresponding to the original cell number (from0) private CellIdBoolean m_originalCell; #endregion #region Methods internal override StringBuilder AsCql(StringBuilder builder, MemberPath outputMember, string blockAlias, int indentLevel) { if (m_expr.IsTrue || m_expr.IsFalse) { // No Case statement for TRUE and FALSE m_expr.AsCql(builder, blockAlias); } else { builder.Append("CASE WHEN "); m_expr.AsCql(builder, blockAlias); builder.Append(" THEN True ELSE False END"); } return builder; } internal override string CqlFieldAlias(MemberPath outputMember) { // Return _from0, _from1 etc return m_originalCell.SlotName; } internal override void ToCompactString(StringBuilder builder) { StringUtil.FormatStringBuilder(builder, "<{0}, ", m_originalCell.SlotName); m_expr.ToCompactString(builder); builder.Append('>'); } #endregion } } // 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.Structures; using System.Text; using System.Diagnostics; using System.Data.Common.Utils; namespace System.Data.Mapping.ViewGeneration.CqlGeneration { // This class represents slots for the boolean variables, e.g., _from0, // _from1, etc internal class BooleanProjectedSlot : ProjectedSlot { #region Constructor // effects: Creates a boolean slot for expression that comes from // originalCellNum, i.e., the value of the slot is "expr" and the // name is "_from", e.g., _from2 internal BooleanProjectedSlot(BoolExpression expr, CqlIdentifiers identifiers, int originalCellNum) { m_expr = expr; m_originalCell = new CellIdBoolean(identifiers, originalCellNum); CellIdBoolean boolExpr = expr.AsLiteral as CellIdBoolean; Debug.Assert(boolExpr == null || BoolLiteral.EqualityComparer.Equals(boolExpr, m_originalCell), "Cellid boolean for the slot and cell number disagree"); } #endregion #region Fields private BoolExpression m_expr; // The actual value of the slot - // could be CellIdBoolean! // A boolean corresponding to the original cell number (from0) private CellIdBoolean m_originalCell; #endregion #region Methods internal override StringBuilder AsCql(StringBuilder builder, MemberPath outputMember, string blockAlias, int indentLevel) { if (m_expr.IsTrue || m_expr.IsFalse) { // No Case statement for TRUE and FALSE m_expr.AsCql(builder, blockAlias); } else { builder.Append("CASE WHEN "); m_expr.AsCql(builder, blockAlias); builder.Append(" THEN True ELSE False END"); } return builder; } internal override string CqlFieldAlias(MemberPath outputMember) { // Return _from0, _from1 etc return m_originalCell.SlotName; } internal override void ToCompactString(StringBuilder builder) { StringUtil.FormatStringBuilder(builder, "<{0}, ", m_originalCell.SlotName); m_expr.ToCompactString(builder); builder.Append('>'); } #endregion } } // 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
- XmlCDATASection.cs
- DerivedKeySecurityToken.cs
- XhtmlMobileTextWriter.cs
- Invariant.cs
- ConfigurationSettings.cs
- XmlSchemaSearchPattern.cs
- Msec.cs
- DbProviderFactoriesConfigurationHandler.cs
- TraceContextEventArgs.cs
- XmlSequenceWriter.cs
- SmtpReplyReaderFactory.cs
- KeyedCollection.cs
- ListItemConverter.cs
- TreeNodeStyle.cs
- COM2ColorConverter.cs
- ProxySimple.cs
- InOutArgumentConverter.cs
- DataTemplateSelector.cs
- externdll.cs
- SizeLimitedCache.cs
- FixedDocumentSequencePaginator.cs
- WorkflowRuntimeServiceElement.cs
- EntityContainer.cs
- ConnectionPoint.cs
- EntityContainerRelationshipSet.cs
- PenCursorManager.cs
- XAMLParseException.cs
- TypeAccessException.cs
- KerberosReceiverSecurityToken.cs
- KeyFrames.cs
- ComplexLine.cs
- EventArgs.cs
- AmbientValueAttribute.cs
- ResourceDictionary.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- EpmContentDeSerializer.cs
- EffectiveValueEntry.cs
- ClientSettingsSection.cs
- CqlWriter.cs
- ConnectionConsumerAttribute.cs
- Subtree.cs
- DataGridViewCellCancelEventArgs.cs
- UnsafeMethods.cs
- PrintPageEvent.cs
- FormsAuthentication.cs
- ClientSection.cs
- ASCIIEncoding.cs
- DefaultAssemblyResolver.cs
- RootBuilder.cs
- UInt32.cs
- TextCompositionEventArgs.cs
- TransactionProtocolConverter.cs
- MinMaxParagraphWidth.cs
- HttpCacheParams.cs
- UnmanagedMemoryStreamWrapper.cs
- EventProperty.cs
- HtmlInputImage.cs
- DesignTimeParseData.cs
- WebBrowserNavigatedEventHandler.cs
- FrameSecurityDescriptor.cs
- DefaultHttpHandler.cs
- AdornerPresentationContext.cs
- DesignerTransaction.cs
- SchemaNamespaceManager.cs
- DataGridViewCheckBoxColumn.cs
- ParameterCollection.cs
- XmlSchemaDatatype.cs
- FtpWebResponse.cs
- parserscommon.cs
- BamlLocalizableResourceKey.cs
- XamlBrushSerializer.cs
- rsa.cs
- TrustManagerPromptUI.cs
- XmlElementCollection.cs
- _AutoWebProxyScriptEngine.cs
- Line.cs
- EditorPart.cs
- ListCommandEventArgs.cs
- DSASignatureDeformatter.cs
- BuildProvider.cs
- DataGridViewAddColumnDialog.cs
- ETagAttribute.cs
- TextViewSelectionProcessor.cs
- MethodImplAttribute.cs
- ParserStreamGeometryContext.cs
- ExpandCollapseProviderWrapper.cs
- TraceInternal.cs
- ClientProtocol.cs
- RequestQueue.cs
- EntryWrittenEventArgs.cs
- DoubleConverter.cs
- SizeLimitedCache.cs
- PriorityItem.cs
- safelink.cs
- BidirectionalDictionary.cs
- HtmlInputReset.cs
- SecurityStandardsManager.cs
- ApplicationHost.cs
- RegisteredDisposeScript.cs
- WCFServiceClientProxyGenerator.cs