Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / Structures / IfJoinedCondition.cs / 2 / 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
- InputElement.cs
- CodeAccessPermission.cs
- SqlDataReaderSmi.cs
- WindowsListView.cs
- FaultException.cs
- TreeBuilder.cs
- SQLDoubleStorage.cs
- PrefixHandle.cs
- AsyncResult.cs
- URLBuilder.cs
- FrugalMap.cs
- KeyGestureValueSerializer.cs
- CreateUserWizardStep.cs
- EnumerableCollectionView.cs
- Compiler.cs
- RunClient.cs
- Point3DKeyFrameCollection.cs
- RemoteHelper.cs
- StickyNoteContentControl.cs
- ValidatorCompatibilityHelper.cs
- XXXInfos.cs
- KeyboardNavigation.cs
- RegexNode.cs
- ConnectionConsumerAttribute.cs
- MetadataPropertyAttribute.cs
- UnsafeNativeMethods.cs
- FeatureSupport.cs
- BitmapDecoder.cs
- SignedXml.cs
- GeneralTransform3DGroup.cs
- RegularExpressionValidator.cs
- PointCollection.cs
- XPathConvert.cs
- WebPartTransformerCollection.cs
- SendActivityValidator.cs
- AppManager.cs
- AllMembershipCondition.cs
- DataServiceConfiguration.cs
- ProviderException.cs
- HuffmanTree.cs
- ViewBase.cs
- WebPartVerb.cs
- ResourceSet.cs
- RegexRunner.cs
- MailAddress.cs
- EmptyEnumerable.cs
- AsyncDataRequest.cs
- RenderCapability.cs
- TransformerInfo.cs
- ShortcutKeysEditor.cs
- EventWaitHandle.cs
- ObjectDataSource.cs
- DeliveryRequirementsAttribute.cs
- ExpressionQuoter.cs
- WindowVisualStateTracker.cs
- Cursors.cs
- ToolStripScrollButton.cs
- DetailsViewPagerRow.cs
- ItemList.cs
- TransportManager.cs
- WeakReference.cs
- WebBrowser.cs
- MaskPropertyEditor.cs
- StrokeCollectionDefaultValueFactory.cs
- WindowsGraphics.cs
- ServiceMetadataExtension.cs
- UdpTransportBindingElement.cs
- AttachmentCollection.cs
- TraceLevelStore.cs
- WmlImageAdapter.cs
- TemplatePropertyEntry.cs
- CodeFieldReferenceExpression.cs
- RelationshipConstraintValidator.cs
- NamedPermissionSet.cs
- CrossSiteScriptingValidation.cs
- JsonSerializer.cs
- XmlWrappingReader.cs
- ListParagraph.cs
- PropertyGeneratedEventArgs.cs
- Storyboard.cs
- WebSysDescriptionAttribute.cs
- DefaultPropertyAttribute.cs
- IgnorePropertiesAttribute.cs
- ImageListStreamer.cs
- AttributeAction.cs
- RunWorkerCompletedEventArgs.cs
- Table.cs
- jithelpers.cs
- followingquery.cs
- DataTableCollection.cs
- COM2ExtendedTypeConverter.cs
- ReaderWriterLock.cs
- CompositeActivityMarkupSerializer.cs
- ResourceWriter.cs
- WebPartAuthorizationEventArgs.cs
- UnsafeNativeMethods.cs
- DataSysAttribute.cs
- Utils.cs
- CompositeDataBoundControl.cs
- QueryParameter.cs