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
- Helpers.cs
- Thread.cs
- Propagator.cs
- DateTimeConverter.cs
- EffectiveValueEntry.cs
- ResourceContainer.cs
- odbcmetadatacollectionnames.cs
- SHA512Managed.cs
- DependentList.cs
- RegisteredExpandoAttribute.cs
- DisableDpiAwarenessAttribute.cs
- PropertyConverter.cs
- LoadRetryHandler.cs
- SettingsBase.cs
- ValidationContext.cs
- DataSetMappper.cs
- IdentityNotMappedException.cs
- OrderByBuilder.cs
- DataGridViewCellStyleChangedEventArgs.cs
- LinkClickEvent.cs
- ColorInterpolationModeValidation.cs
- CutCopyPasteHelper.cs
- PasswordPropertyTextAttribute.cs
- SyndicationDeserializer.cs
- MailDefinition.cs
- TextTabProperties.cs
- DbgCompiler.cs
- ExecutionContext.cs
- NamespaceList.cs
- ClientScriptManagerWrapper.cs
- BindingMemberInfo.cs
- XmlEntityReference.cs
- ContextMenuAutomationPeer.cs
- URLBuilder.cs
- EventLogger.cs
- ECDsaCng.cs
- WebPartTracker.cs
- PathData.cs
- AsymmetricKeyExchangeFormatter.cs
- BlurBitmapEffect.cs
- BaseProcessor.cs
- SystemIPv4InterfaceProperties.cs
- WindowsToolbar.cs
- EntityReference.cs
- UriTemplateLiteralQueryValue.cs
- SecurityKeyEntropyMode.cs
- TimeSpanValidator.cs
- WindowsListViewItemStartMenu.cs
- HeaderElement.cs
- CurrencyManager.cs
- SendContent.cs
- TransportDefaults.cs
- HttpResponseHeader.cs
- HostExecutionContextManager.cs
- PeerEndPoint.cs
- HttpRequestContext.cs
- UnsafeNativeMethods.cs
- ConfigXmlDocument.cs
- TaskResultSetter.cs
- XamlBrushSerializer.cs
- RouteValueDictionary.cs
- StaticResourceExtension.cs
- CredentialManagerDialog.cs
- BuildDependencySet.cs
- ParenExpr.cs
- StoreUtilities.cs
- BitmapEffectDrawingContent.cs
- ProcessManager.cs
- IApplicationTrustManager.cs
- InvalidPrinterException.cs
- CatalogZone.cs
- TemplateField.cs
- TypedReference.cs
- SiteMapNode.cs
- TypeDefinition.cs
- ChannelManager.cs
- CodeTypeMember.cs
- ColorMatrix.cs
- XmlUtil.cs
- ToolBarButton.cs
- ProcessProtocolHandler.cs
- ToolStripStatusLabel.cs
- StringCollection.cs
- XmlConvert.cs
- AttachmentCollection.cs
- DesignColumn.cs
- SearchExpression.cs
- DesignerActionPropertyItem.cs
- DbDataRecord.cs
- SslStreamSecurityElement.cs
- ThemeDirectoryCompiler.cs
- UniqueIdentifierService.cs
- CodeDirectoryCompiler.cs
- Opcode.cs
- DBNull.cs
- GuidelineCollection.cs
- IPHostEntry.cs
- DescendantBaseQuery.cs
- DockEditor.cs
- Logging.cs