Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Common / EntitySql / AST / DotExpr.cs / 1305376 / DotExpr.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- namespace System.Data.Common.EntitySql.AST { using System; using System.Globalization; using System.Collections; using System.Collections.Generic; using System.Diagnostics; ////// Represents dotExpr: expr.Identifier /// internal sealed class DotExpr : Node { private readonly Node _leftExpr; private readonly Identifier _identifier; private bool? _isMultipartIdentifierComputed; private string[] _names; ////// initializes /// internal DotExpr(Node leftExpr, Identifier id) { _leftExpr = leftExpr; _identifier = id; } ////// For the following expression: "a.b.c.d", Left returns "a.b.c". /// internal Node Left { get { return _leftExpr; } } ////// For the following expression: "a.b.c.d", Identifier returns "d". /// internal Identifier Identifier { get { return _identifier; } } ////// Returns true if all parts of this expression are identifiers like in "a.b.c", /// false for expressions like "FunctionCall().a.b.c". /// internal bool IsMultipartIdentifier(out string[] names) { if (_isMultipartIdentifierComputed.HasValue) { names = _names; return _isMultipartIdentifierComputed.Value; } _names = null; Identifier leftIdenitifier = _leftExpr as Identifier; if (leftIdenitifier != null) { _names = new string[] { leftIdenitifier.Name, _identifier.Name }; } DotExpr leftDotExpr = _leftExpr as DotExpr; string[] leftNames; if (leftDotExpr != null && leftDotExpr.IsMultipartIdentifier(out leftNames)) { _names = new string[leftNames.Length + 1]; leftNames.CopyTo(_names, 0); _names[_names.Length - 1] = _identifier.Name; } Debug.Assert(_names == null || _names.Length > 0, "_names must be null or non-empty"); _isMultipartIdentifierComputed = _names != null; names = _names; return _isMultipartIdentifierComputed.Value; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- namespace System.Data.Common.EntitySql.AST { using System; using System.Globalization; using System.Collections; using System.Collections.Generic; using System.Diagnostics; ////// Represents dotExpr: expr.Identifier /// internal sealed class DotExpr : Node { private readonly Node _leftExpr; private readonly Identifier _identifier; private bool? _isMultipartIdentifierComputed; private string[] _names; ////// initializes /// internal DotExpr(Node leftExpr, Identifier id) { _leftExpr = leftExpr; _identifier = id; } ////// For the following expression: "a.b.c.d", Left returns "a.b.c". /// internal Node Left { get { return _leftExpr; } } ////// For the following expression: "a.b.c.d", Identifier returns "d". /// internal Identifier Identifier { get { return _identifier; } } ////// Returns true if all parts of this expression are identifiers like in "a.b.c", /// false for expressions like "FunctionCall().a.b.c". /// internal bool IsMultipartIdentifier(out string[] names) { if (_isMultipartIdentifierComputed.HasValue) { names = _names; return _isMultipartIdentifierComputed.Value; } _names = null; Identifier leftIdenitifier = _leftExpr as Identifier; if (leftIdenitifier != null) { _names = new string[] { leftIdenitifier.Name, _identifier.Name }; } DotExpr leftDotExpr = _leftExpr as DotExpr; string[] leftNames; if (leftDotExpr != null && leftDotExpr.IsMultipartIdentifier(out leftNames)) { _names = new string[leftNames.Length + 1]; leftNames.CopyTo(_names, 0); _names[_names.Length - 1] = _identifier.Name; } Debug.Assert(_names == null || _names.Length > 0, "_names must be null or non-empty"); _isMultipartIdentifierComputed = _names != null; names = _names; return _isMultipartIdentifierComputed.Value; } } } // 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
- SqlConnectionString.cs
- InfoCardUIAgent.cs
- _AutoWebProxyScriptEngine.cs
- HMACSHA1.cs
- TargetConverter.cs
- DiagnosticTrace.cs
- VisualStates.cs
- OleDbWrapper.cs
- TableCell.cs
- CommonGetThemePartSize.cs
- TargetPerspective.cs
- HtmlCalendarAdapter.cs
- SqlXml.cs
- DrawingVisual.cs
- DataSourceIDConverter.cs
- FileDocument.cs
- SQLBinaryStorage.cs
- CachedCompositeFamily.cs
- CreateRefExpr.cs
- StringDictionary.cs
- ResourceContainerWrapper.cs
- BindingNavigator.cs
- SerializationEventsCache.cs
- XmlSchemaAnyAttribute.cs
- AnnotationResourceCollection.cs
- HtmlInputHidden.cs
- ImageCodecInfoPrivate.cs
- Page.cs
- VisualStyleInformation.cs
- VariableDesigner.xaml.cs
- DiscreteKeyFrames.cs
- DrawItemEvent.cs
- RegistrySecurity.cs
- Typography.cs
- RequestCachePolicy.cs
- CodeVariableReferenceExpression.cs
- WebPartCatalogAddVerb.cs
- WindowsSlider.cs
- QilTargetType.cs
- TypeExtensionConverter.cs
- CachedTypeface.cs
- RtfFormatStack.cs
- StreamUpdate.cs
- _UriTypeConverter.cs
- MouseBinding.cs
- RadioButtonList.cs
- GestureRecognizer.cs
- TypeToken.cs
- EmptyElement.cs
- CaseInsensitiveHashCodeProvider.cs
- SkewTransform.cs
- SignatureHelper.cs
- ISFTagAndGuidCache.cs
- OrthographicCamera.cs
- Constraint.cs
- Inflater.cs
- Models.cs
- GroupStyle.cs
- X509ThumbprintKeyIdentifierClause.cs
- BindingsCollection.cs
- WebPartConnectionsDisconnectVerb.cs
- InstancePersistenceEvent.cs
- OleDbConnectionInternal.cs
- EditorZoneAutoFormat.cs
- Point3DCollectionConverter.cs
- WindowsGraphicsWrapper.cs
- PriorityChain.cs
- Rect.cs
- DescendentsWalkerBase.cs
- ReliableChannelListener.cs
- Errors.cs
- XmlUtil.cs
- mediapermission.cs
- WebPartConnectionsCancelVerb.cs
- smtppermission.cs
- Renderer.cs
- OrderedParallelQuery.cs
- BinaryFormatter.cs
- ExplicitDiscriminatorMap.cs
- RowBinding.cs
- ProxyWebPartManager.cs
- ProxyAttribute.cs
- X509CertificateChain.cs
- BitmapScalingModeValidation.cs
- SuppressedPackageProperties.cs
- ProbeRequestResponseAsyncResult.cs
- SelectingProviderEventArgs.cs
- DocumentPageTextView.cs
- CurrencyManager.cs
- DesignConnectionCollection.cs
- ProcessHost.cs
- PopupRootAutomationPeer.cs
- ImageField.cs
- EventsTab.cs
- AppearanceEditorPart.cs
- DataGridViewColumnHeaderCell.cs
- Assert.cs
- PrintDialogException.cs
- RankException.cs
- UnsafeNativeMethods.cs