Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Map / ViewGeneration / Structures / CellIdBoolean.cs / 1305376 / CellIdBoolean.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System.Data.Common.Utils.Boolean; using System.Text; using System.Collections.Generic; using System.Data.Common.Utils; using System.Data.Mapping.ViewGeneration.CqlGeneration; using System.Data.Mapping.ViewGeneration.Utils; using System.Diagnostics; namespace System.Data.Mapping.ViewGeneration.Structures { using DomainBoolExpr = BoolExpr>; using DomainNotExpr = NotExpr >; using DomainTermExpr = TermExpr >; using System.Data.Entity; /// /// Wraps from0, from1, etc. boolean fields that identify /// the source of tuples (# of respective cell query) in the view statements /// internal class CellIdBoolean : TrueFalseLiteral { #region Constructor // effects: Creates a boolean expression for the variable name // specified by "index", e.g., 0 results in from0, 1 into from1 internal CellIdBoolean(CqlIdentifiers identifiers, int index) { Debug.Assert(index >= 0); m_identifiers = identifiers; m_index = index; } #endregion #region Fields private int m_index; // e.g., from0, from1 private CqlIdentifiers m_identifiers; // Whether the prefix should be _from or something more complicated due to collisions #endregion #region Properties // effects: Returns the slotName corresponding to this, ie., _from0 etc internal string SlotName { get { string result = m_identifiers.GetFromVariable(m_index); return result; } } #endregion #region BoolLiteral members internal override StringBuilder AsCql(StringBuilder builder, string blockAlias, bool canSkipIsNotNull) { // Get e.g., T2._from1 using the table alias string qualifiedName = CqlWriter.GetQualifiedName(blockAlias, SlotName); builder.Append(qualifiedName); 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; } internal override void GetRequiredSlots(MemberProjectionIndex projectedSlotMap, bool[] requiredSlots) { // The slot corresponding to from1, etc int numBoolSlots = requiredSlots.Length - projectedSlotMap.Count; int slotNum = ProjectedSlot.BoolIndexToSlot(m_index, projectedSlotMap, numBoolSlots); requiredSlots[slotNum] = true; } protected override bool IsEqualTo(BoolLiteral right) { CellIdBoolean rightBoolean = right as CellIdBoolean; if (rightBoolean == null) { return false; } return m_index == rightBoolean.m_index; } protected override int GetHash() { return m_index.GetHashCode(); } // effects: See BoolExpression.RemapBool internal override BoolLiteral RemapBool(Dictionaryremap) { return this; } #endregion #region Other Methods internal override void ToCompactString(StringBuilder builder) { builder.Append(SlotName); } #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
- XmlSchemaException.cs
- PeerCollaborationPermission.cs
- SqlCacheDependencyDatabase.cs
- _CacheStreams.cs
- RotateTransform.cs
- LogStream.cs
- XPathNodeIterator.cs
- AdornerDecorator.cs
- LifetimeServices.cs
- SamlAudienceRestrictionCondition.cs
- MethodAccessException.cs
- SecUtil.cs
- VisualBrush.cs
- KnowledgeBase.cs
- OleStrCAMarshaler.cs
- XmlAttributeCache.cs
- DataGridViewRowStateChangedEventArgs.cs
- EditorZoneBase.cs
- hresults.cs
- MergePropertyDescriptor.cs
- PngBitmapDecoder.cs
- SqlServer2KCompatibilityCheck.cs
- Decimal.cs
- ExpressionCopier.cs
- AuthenticationManager.cs
- WebBrowsableAttribute.cs
- AutomationIdentifierGuids.cs
- SiteMapNodeItem.cs
- InstalledVoice.cs
- InputLanguageSource.cs
- Material.cs
- documentation.cs
- CompositionAdorner.cs
- PathFigureCollection.cs
- InvariantComparer.cs
- WsatStrings.cs
- CustomError.cs
- ISAPIApplicationHost.cs
- RowToParametersTransformer.cs
- PrintPageEvent.cs
- VectorCollectionConverter.cs
- NegotiateStream.cs
- EFAssociationProvider.cs
- AnyAllSearchOperator.cs
- DesignTimeType.cs
- SmtpTransport.cs
- PolicyReader.cs
- SpotLight.cs
- OdbcRowUpdatingEvent.cs
- DefaultTraceListener.cs
- ReferenceEqualityComparer.cs
- SettingsPropertyCollection.cs
- PrimitiveDataContract.cs
- HiddenField.cs
- InstanceContext.cs
- SapiRecoInterop.cs
- DocumentCollection.cs
- ScriptRegistrationManager.cs
- TemplateKey.cs
- HoistedLocals.cs
- HyperLink.cs
- DelimitedListTraceListener.cs
- XslException.cs
- mediapermission.cs
- EventListenerClientSide.cs
- EventRoute.cs
- KeyValueConfigurationCollection.cs
- DataGridViewCellCancelEventArgs.cs
- FloaterBaseParaClient.cs
- DbLambda.cs
- Tablet.cs
- CompilationUtil.cs
- ReadWriteSpinLock.cs
- CodeTypeDeclaration.cs
- CssTextWriter.cs
- ValueTable.cs
- uribuilder.cs
- HelpInfo.cs
- Matrix.cs
- Buffer.cs
- ScrollProperties.cs
- ScrollEventArgs.cs
- PartialCachingAttribute.cs
- TextBoxAutoCompleteSourceConverter.cs
- HtmlForm.cs
- BufferedGraphicsContext.cs
- PrimitiveCodeDomSerializer.cs
- ColorInterpolationModeValidation.cs
- FontUnit.cs
- UdpTransportSettings.cs
- DesignerActionListCollection.cs
- SoapAttributes.cs
- WaitHandle.cs
- BaseDataList.cs
- Solver.cs
- CodeTypeOfExpression.cs
- WindowsListViewGroupHelper.cs
- XmlTextEncoder.cs
- Brushes.cs
- EventWaitHandleSecurity.cs