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 / Structures / IfJoinedCondition.cs / 1 / IfJoinedCondition.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Text; using System.Collections.Generic; using System.Diagnostics; namespace System.Data.Mapping.ViewGeneration.Structures { // A class that denotes the boolean expression: "IfJoined(var)", i.e. in // a jointree, if a tuple is received from the right side of an LOJ, this // variable is true on the right child of the LOJ node -- useful for compositions internal class IfJoinedCondition : TrueFalseLiteral { // effects: Given a join tree slot "node", returns a boolean // expression of the form "IfJoined(node) in {true}" internal IfJoinedCondition(JoinTreeNode node) { m_var = new JoinTreeSlot(node); } #region Fields private JoinTreeSlot m_var; #endregion #region Properties // effects: Returns the variable in this internal JoinTreeSlot Var { get { return m_var; } } #endregion #region String methods internal override void ToCompactString(StringBuilder builder) { builder.Append("IfJoined("); Var.ToCompactString(builder); builder.Append(")"); } #endregion #region BoolLiteral Members // effects: See BoolExpression.RemapBool internal override BoolLiteral RemapBool(Dictionaryremap) { JoinTreeSlot newVar = (JoinTreeSlot)m_var.RemapSlot(remap); return new IfJoinedCondition(newVar.JoinTreeNode); } internal override StringBuilder AsCql(StringBuilder builder, string blockAlias, bool canSkipIsNotNull) { // CHANGE_[....]_FEATURE_COMPOSITION Debug.Fail("Support for compositions missing"); return builder; } internal override StringBuilder AsUserString(StringBuilder builder, string blockAlias, bool canSkipIsNotNull) { return AsCql(builder, blockAlias, canSkipIsNotNull); } internal override StringBuilder AsNegatedUserString(StringBuilder builder, string blockAlias, bool canSkipIsNotNull) { builder.Append("NOT("); builder = AsUserString(builder, blockAlias, canSkipIsNotNull); builder.Append(")"); return builder; } // effects: See BoolExpression.GetRequiredSlots internal override void GetRequiredSlots(MemberPathMapBase projectedSlotMap, bool[] requiredSlots) { // Simply get the slot for the variable var in "var in values" MemberPath member = Var.MemberPath; int slotNum = projectedSlotMap.IndexOf(member); requiredSlots[slotNum] = true; } #endregion protected override bool IsEqualTo(BoolLiteral right) { IfJoinedCondition rightCond = right as IfJoinedCondition; if (rightCond == null) { return false; } if (object.ReferenceEquals(this, rightCond)) { return true; } return JoinTreeSlot.EqualityComparer.Equals(m_var, rightCond.m_var); } protected override int GetHash() { int result = JoinTreeSlot.EqualityComparer.GetHashCode(m_var); return result; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Text; using System.Collections.Generic; using System.Diagnostics; namespace System.Data.Mapping.ViewGeneration.Structures { // A class that denotes the boolean expression: "IfJoined(var)", i.e. in // a jointree, if a tuple is received from the right side of an LOJ, this // variable is true on the right child of the LOJ node -- useful for compositions internal class IfJoinedCondition : TrueFalseLiteral { // effects: Given a join tree slot "node", returns a boolean // expression of the form "IfJoined(node) in {true}" internal IfJoinedCondition(JoinTreeNode node) { m_var = new JoinTreeSlot(node); } #region Fields private JoinTreeSlot m_var; #endregion #region Properties // effects: Returns the variable in this internal JoinTreeSlot Var { get { return m_var; } } #endregion #region String methods internal override void ToCompactString(StringBuilder builder) { builder.Append("IfJoined("); Var.ToCompactString(builder); builder.Append(")"); } #endregion #region BoolLiteral Members // effects: See BoolExpression.RemapBool internal override BoolLiteral RemapBool(Dictionaryremap) { JoinTreeSlot newVar = (JoinTreeSlot)m_var.RemapSlot(remap); return new IfJoinedCondition(newVar.JoinTreeNode); } internal override StringBuilder AsCql(StringBuilder builder, string blockAlias, bool canSkipIsNotNull) { // CHANGE_[....]_FEATURE_COMPOSITION Debug.Fail("Support for compositions missing"); return builder; } internal override StringBuilder AsUserString(StringBuilder builder, string blockAlias, bool canSkipIsNotNull) { return AsCql(builder, blockAlias, canSkipIsNotNull); } internal override StringBuilder AsNegatedUserString(StringBuilder builder, string blockAlias, bool canSkipIsNotNull) { builder.Append("NOT("); builder = AsUserString(builder, blockAlias, canSkipIsNotNull); builder.Append(")"); return builder; } // effects: See BoolExpression.GetRequiredSlots internal override void GetRequiredSlots(MemberPathMapBase projectedSlotMap, bool[] requiredSlots) { // Simply get the slot for the variable var in "var in values" MemberPath member = Var.MemberPath; int slotNum = projectedSlotMap.IndexOf(member); requiredSlots[slotNum] = true; } #endregion protected override bool IsEqualTo(BoolLiteral right) { IfJoinedCondition rightCond = right as IfJoinedCondition; if (rightCond == null) { return false; } if (object.ReferenceEquals(this, rightCond)) { return true; } return JoinTreeSlot.EqualityComparer.Equals(m_var, rightCond.m_var); } protected override int GetHash() { int result = JoinTreeSlot.EqualityComparer.GetHashCode(m_var); return result; } } } // 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
- ListViewSortEventArgs.cs
- ImageUrlEditor.cs
- TableCell.cs
- IPGlobalProperties.cs
- ToolStripDropDownMenu.cs
- AlternationConverter.cs
- EntityParameterCollection.cs
- QuotedPrintableStream.cs
- Point3DAnimationBase.cs
- _Win32.cs
- OleServicesContext.cs
- ConfigsHelper.cs
- InstanceDescriptor.cs
- SyndicationDeserializer.cs
- DataViewSettingCollection.cs
- Bezier.cs
- RenameRuleObjectDialog.cs
- StorageAssociationTypeMapping.cs
- _LocalDataStore.cs
- SuppressMergeCheckAttribute.cs
- UrlAuthFailedErrorFormatter.cs
- EncoderExceptionFallback.cs
- ContainerParagraph.cs
- CodeExpressionCollection.cs
- DateTimeConverter2.cs
- WebHttpBehavior.cs
- GeneratedView.cs
- TypeHelpers.cs
- MediaPlayerState.cs
- XmlDataSourceNodeDescriptor.cs
- IQueryable.cs
- AxWrapperGen.cs
- DmlSqlGenerator.cs
- ProxyGenerator.cs
- BindingFormattingDialog.cs
- ChtmlTextWriter.cs
- XmlNamespaceManager.cs
- MouseGesture.cs
- ResourcePermissionBaseEntry.cs
- coordinatorscratchpad.cs
- SingleConverter.cs
- PropertyDescriptorCollection.cs
- RelationalExpressions.cs
- _ShellExpression.cs
- MsmqProcessProtocolHandler.cs
- mactripleDES.cs
- baseaxisquery.cs
- ExpressionBindingCollection.cs
- MenuItemCollection.cs
- Object.cs
- TreeNodeCollectionEditorDialog.cs
- IntSecurity.cs
- Matrix3D.cs
- Command.cs
- WindowsRegion.cs
- DesignerLoader.cs
- TransactionScopeDesigner.cs
- SystemFonts.cs
- Utils.cs
- MultipleViewProviderWrapper.cs
- ProgressPage.cs
- LogConverter.cs
- StyleHelper.cs
- DataBoundControl.cs
- Util.cs
- XamlSerializer.cs
- TypeSystemHelpers.cs
- WindowsToolbarItemAsMenuItem.cs
- TextProperties.cs
- WebReferencesBuildProvider.cs
- TraceShell.cs
- errorpatternmatcher.cs
- CacheMode.cs
- GridViewUpdateEventArgs.cs
- GeneralTransformGroup.cs
- localization.cs
- _AuthenticationState.cs
- DSASignatureFormatter.cs
- QilValidationVisitor.cs
- DBConnection.cs
- RuntimeIdentifierPropertyAttribute.cs
- WebPartTracker.cs
- DiscriminatorMap.cs
- MetadataItemEmitter.cs
- WebRequest.cs
- TrustLevel.cs
- SrgsDocument.cs
- DebugHandleTracker.cs
- XamlTreeBuilder.cs
- MouseGestureValueSerializer.cs
- ProcessRequestArgs.cs
- VideoDrawing.cs
- DataServiceHostFactory.cs
- Vector3DConverter.cs
- HttpWebRequest.cs
- EditorZone.cs
- ColorConvertedBitmap.cs
- TimersDescriptionAttribute.cs
- CommandHelpers.cs
- AttachedAnnotation.cs