Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- CalendarDataBindingHandler.cs
- WebConfigurationManager.cs
- DelegatedStream.cs
- GrammarBuilderWildcard.cs
- SafeEventLogWriteHandle.cs
- InstanceDataCollection.cs
- EmptyReadOnlyDictionaryInternal.cs
- DomainConstraint.cs
- BindingElement.cs
- TextPatternIdentifiers.cs
- PassportPrincipal.cs
- WebBrowserUriTypeConverter.cs
- ConnectionConsumerAttribute.cs
- DataServiceConfiguration.cs
- DynamicMethod.cs
- StructuralObject.cs
- QilStrConcatenator.cs
- StringValueConverter.cs
- TaiwanCalendar.cs
- HttpDictionary.cs
- DataGridViewIntLinkedList.cs
- CursorConverter.cs
- Journal.cs
- StyleCollection.cs
- OneToOneMappingSerializer.cs
- HashMembershipCondition.cs
- ThreadInterruptedException.cs
- RightsManagementPermission.cs
- ColumnWidthChangingEvent.cs
- EncoderParameter.cs
- HtmlElementErrorEventArgs.cs
- HwndSource.cs
- Rect3D.cs
- ListViewInsertedEventArgs.cs
- CustomValidator.cs
- XmlILStorageConverter.cs
- DesignerExtenders.cs
- BuildProvider.cs
- querybuilder.cs
- DocumentViewer.cs
- UidManager.cs
- BufferedStream.cs
- WebPartDisplayModeCollection.cs
- ResourceManager.cs
- PackageRelationshipCollection.cs
- ModuleBuilder.cs
- DefaultValidator.cs
- SchemaCollectionCompiler.cs
- InstanceKeyView.cs
- NGCSerializationManagerAsync.cs
- _Rfc2616CacheValidators.cs
- Lasso.cs
- ByteBufferPool.cs
- RowBinding.cs
- RowUpdatedEventArgs.cs
- OpacityConverter.cs
- DataObjectSettingDataEventArgs.cs
- TraceHwndHost.cs
- InstanceLockQueryResult.cs
- WebBaseEventKeyComparer.cs
- ManipulationLogic.cs
- DataExpression.cs
- TextContainer.cs
- SoapElementAttribute.cs
- OracleTimeSpan.cs
- DbConnectionPoolOptions.cs
- _DigestClient.cs
- DataGridCell.cs
- AccessDataSource.cs
- ProcessHostMapPath.cs
- CellRelation.cs
- ValidationSummary.cs
- DataGridItemCollection.cs
- RawStylusActions.cs
- RubberbandSelector.cs
- AttributeQuery.cs
- LinqMaximalSubtreeNominator.cs
- VisualStyleElement.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- Errors.cs
- ProtocolsConfiguration.cs
- Point4DValueSerializer.cs
- XmlSequenceWriter.cs
- DeclaredTypeElementCollection.cs
- ProfileManager.cs
- CodeBinaryOperatorExpression.cs
- PropertyIDSet.cs
- DataStorage.cs
- TemplateInstanceAttribute.cs
- PageEventArgs.cs
- Size3D.cs
- DiscoveryDocumentLinksPattern.cs
- EventSetter.cs
- EntityEntry.cs
- QilXmlReader.cs
- ViewBox.cs
- ConditionalAttribute.cs
- CodeExpressionStatement.cs
- EmptyEnumerator.cs
- ErrorInfoXmlDocument.cs