Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- CompoundFileDeflateTransform.cs
- ExtensionFile.cs
- DataGridTextBox.cs
- ColumnCollection.cs
- ByValueEqualityComparer.cs
- XmlSchemaImport.cs
- SqlConnectionManager.cs
- LineProperties.cs
- PeerContact.cs
- StringCollection.cs
- SiteMapNodeItem.cs
- NavigationWindowAutomationPeer.cs
- WCFModelStrings.Designer.cs
- Preprocessor.cs
- AsyncPostBackTrigger.cs
- _ShellExpression.cs
- GetParentChain.cs
- DoubleCollection.cs
- KeyedCollection.cs
- RelationshipManager.cs
- SettingsAttributes.cs
- PersonalizationStateInfo.cs
- ChannelManagerBase.cs
- Span.cs
- WebPartHeaderCloseVerb.cs
- UxThemeWrapper.cs
- ObservableCollection.cs
- PermissionSet.cs
- TemplateBindingExtension.cs
- DataGridViewColumnHeaderCell.cs
- PropertyGridCommands.cs
- PrivacyNoticeBindingElement.cs
- SuspendDesigner.cs
- SeekStoryboard.cs
- PointF.cs
- CommandField.cs
- SystemBrushes.cs
- ContainerParagraph.cs
- ViewStateModeByIdAttribute.cs
- LinqExpressionNormalizer.cs
- NetCodeGroup.cs
- DataColumnSelectionConverter.cs
- AlphaSortedEnumConverter.cs
- DbConnectionInternal.cs
- BufferBuilder.cs
- AutomationEventArgs.cs
- streamingZipPartStream.cs
- ReliableSessionBindingElement.cs
- ActivityScheduledRecord.cs
- InputBindingCollection.cs
- WinFormsSecurity.cs
- TemplateLookupAction.cs
- BitmapPalette.cs
- COM2Properties.cs
- XmlCharType.cs
- ValueSerializerAttribute.cs
- ValidationResult.cs
- EditorPartChrome.cs
- EnumerableRowCollection.cs
- ColorContextHelper.cs
- SmiConnection.cs
- XamlBuildTaskServices.cs
- Comparer.cs
- TemplatedMailWebEventProvider.cs
- CodeEntryPointMethod.cs
- QilPatternVisitor.cs
- ParseChildrenAsPropertiesAttribute.cs
- BuildProviderCollection.cs
- RegistryHandle.cs
- WriterOutput.cs
- ItemChangedEventArgs.cs
- DateTimeFormatInfo.cs
- XmlComment.cs
- IndependentAnimationStorage.cs
- ProbeMatchesMessageCD1.cs
- FileUtil.cs
- MonthChangedEventArgs.cs
- Peer.cs
- SelectionItemPattern.cs
- DataGridColumnHeader.cs
- XmlSerializerObjectSerializer.cs
- MemberPathMap.cs
- SqlOuterApplyReducer.cs
- ToRequest.cs
- LicFileLicenseProvider.cs
- ExtensionFile.cs
- WmlControlAdapter.cs
- WebPartConnectionsCancelVerb.cs
- PropertyEmitter.cs
- CompositeDesignerAccessibleObject.cs
- NativeMethods.cs
- TemplateBindingExpressionConverter.cs
- DBConcurrencyException.cs
- GPPOINT.cs
- DataGridViewCellFormattingEventArgs.cs
- NetNamedPipeSecurity.cs
- TreeViewImageKeyConverter.cs
- XMLSchema.cs
- QilLoop.cs
- ReversePositionQuery.cs