Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / CqlGeneration / BooleanProjectedSlot.cs / 1 / 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
- DBConnection.cs
- DynamicActionMessageFilter.cs
- NavigationEventArgs.cs
- PointF.cs
- TemplateKeyConverter.cs
- PreloadedPackages.cs
- InfiniteIntConverter.cs
- ToolTipAutomationPeer.cs
- GeometryGroup.cs
- Speller.cs
- MexServiceChannelBuilder.cs
- DataTransferEventArgs.cs
- TypeListConverter.cs
- TargetConverter.cs
- CodeDirectiveCollection.cs
- Activity.cs
- InputLangChangeEvent.cs
- BitmapPalette.cs
- VariantWrapper.cs
- RowUpdatingEventArgs.cs
- MultiView.cs
- UidManager.cs
- RegionData.cs
- HandlerBase.cs
- FileRecordSequence.cs
- FrameworkTemplate.cs
- DllNotFoundException.cs
- ResolveCriteriaApril2005.cs
- _MultipleConnectAsync.cs
- IndexerHelper.cs
- ObjectTypeMapping.cs
- AuthenticationConfig.cs
- Attributes.cs
- CodeAccessSecurityEngine.cs
- XMLSchema.cs
- TextOnlyOutput.cs
- clipboard.cs
- PropertyMetadata.cs
- StrongBox.cs
- TextAdaptor.cs
- Tag.cs
- QuadraticBezierSegment.cs
- ThemeDirectoryCompiler.cs
- DrawingGroupDrawingContext.cs
- NotConverter.cs
- StringHandle.cs
- SimpleBitVector32.cs
- BuilderInfo.cs
- SoundPlayer.cs
- ICollection.cs
- SByteConverter.cs
- Hex.cs
- errorpatternmatcher.cs
- PtsContext.cs
- ErrorStyle.cs
- XPathBuilder.cs
- ExpandedWrapper.cs
- PublisherIdentityPermission.cs
- MbpInfo.cs
- CompositeScriptReferenceEventArgs.cs
- CodeTypeReferenceSerializer.cs
- TrustLevel.cs
- ReflectEventDescriptor.cs
- SqlInternalConnectionSmi.cs
- OrderToken.cs
- RelOps.cs
- XmlSchemaSimpleType.cs
- CompleteWizardStep.cs
- Matrix.cs
- Calendar.cs
- CompiledXpathExpr.cs
- UrlPath.cs
- Nodes.cs
- ClaimTypeElementCollection.cs
- TagPrefixInfo.cs
- PenLineJoinValidation.cs
- MediaTimeline.cs
- SelectionListComponentEditor.cs
- RightNameExpirationInfoPair.cs
- PersonalizationStateInfo.cs
- EmptyStringExpandableObjectConverter.cs
- IntSecurity.cs
- TemplateKeyConverter.cs
- PropagatorResult.cs
- DiagnosticsConfiguration.cs
- WsatTransactionFormatter.cs
- BaseTemplateBuildProvider.cs
- SHA384.cs
- X509UI.cs
- Material.cs
- XmlSchemaAttribute.cs
- ServiceBuildProvider.cs
- InvariantComparer.cs
- CookieProtection.cs
- NumericExpr.cs
- DBCSCodePageEncoding.cs
- ComponentCommands.cs
- ClipboardProcessor.cs
- AssemblyBuilder.cs
- CrossAppDomainChannel.cs