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
- Binding.cs
- HttpWebRequestElement.cs
- BoundColumn.cs
- DataGridColumnStyleMappingNameEditor.cs
- SID.cs
- WindowsListViewItem.cs
- TextTabProperties.cs
- DoubleKeyFrameCollection.cs
- PrintPageEvent.cs
- DataReceivedEventArgs.cs
- PropertyValueChangedEvent.cs
- UInt32Storage.cs
- NativeStructs.cs
- ObjectSpanRewriter.cs
- EntityClassGenerator.cs
- HtmlContainerControl.cs
- Control.cs
- SchemaEntity.cs
- AnnotationAdorner.cs
- RewritingValidator.cs
- DataObjectSettingDataEventArgs.cs
- PersonalizationStateInfoCollection.cs
- AsyncPostBackTrigger.cs
- ExpressionsCollectionConverter.cs
- EnumValidator.cs
- DesignerEventService.cs
- StackOverflowException.cs
- EndpointAddressMessageFilter.cs
- ThreadStartException.cs
- DoubleConverter.cs
- TypeContext.cs
- StringDictionary.cs
- ClientTarget.cs
- SoapInteropTypes.cs
- StringUtil.cs
- HttpPostedFileBase.cs
- TrustLevelCollection.cs
- XamlNamespaceHelper.cs
- NumberFormatInfo.cs
- GlyphElement.cs
- StrokeCollection2.cs
- ProvidersHelper.cs
- IDataContractSurrogate.cs
- UserControl.cs
- InstanceOwner.cs
- XmlStreamStore.cs
- Operators.cs
- TabPage.cs
- DataGridViewCellStateChangedEventArgs.cs
- ProxyHelper.cs
- PathSegment.cs
- _SslState.cs
- ChameleonKey.cs
- TableItemPatternIdentifiers.cs
- TextElementAutomationPeer.cs
- DataGridHeaderBorder.cs
- StrokeRenderer.cs
- TableLayoutPanelCodeDomSerializer.cs
- WebHttpBehavior.cs
- DesignTimeParseData.cs
- XmlSchemaObjectCollection.cs
- EntityDesignerDataSourceView.cs
- ExpressionEditorSheet.cs
- ObjectTokenCategory.cs
- OneToOneMappingSerializer.cs
- CodeParameterDeclarationExpression.cs
- DBCommandBuilder.cs
- MediaCommands.cs
- MapPathBasedVirtualPathProvider.cs
- XmlChildEnumerator.cs
- Repeater.cs
- codemethodreferenceexpression.cs
- WebPartDescription.cs
- Automation.cs
- JsonObjectDataContract.cs
- EventLogger.cs
- IisTraceListener.cs
- OpenTypeCommon.cs
- FrameworkContentElement.cs
- DiscoveryReferences.cs
- BuildProviderCollection.cs
- ServiceDescriptionImporter.cs
- activationcontext.cs
- BrushMappingModeValidation.cs
- TCPListener.cs
- PrinterUnitConvert.cs
- PageRanges.cs
- Activity.cs
- SqlDataRecord.cs
- InputReport.cs
- XPathSelectionIterator.cs
- BinaryCommonClasses.cs
- TransportSecurityBindingElement.cs
- autovalidator.cs
- AsymmetricSecurityProtocol.cs
- DynamicDataManager.cs
- StrongBox.cs
- GroupByExpressionRewriter.cs
- ZipIOExtraFieldZip64Element.cs
- TemplatePropertyEntry.cs