Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataEntity / System / Data / Common / EntitySql / NamespaceExpr.cs / 2 / NamespaceExpr.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] [....] //--------------------------------------------------------------------- namespace System.Data.Common.EntitySql { using System; using System.Globalization; using System.Collections; using System.Collections.Generic; ////// represents an ast node for namespace declaration /// internal sealed class NamespaceExpr : Expr { private Identifier _namespaceAlias; private DottedIdentifier _namespaceName; ////// initializes ns as single id /// /// internal NamespaceExpr( Identifier identifier ) { _namespaceName = new DottedIdentifier(identifier); } ////// initializes ns as a dotted id /// /// internal NamespaceExpr( DotExpr dotExpr ) { if (!dotExpr.IsDottedIdentifier) { throw EntityUtil.EntitySqlError(dotExpr.ErrCtx, System.Data.Entity.Strings.InvalidNamespace); } _namespaceName = new DottedIdentifier(dotExpr); } ////// initializes aliased ns /// /// ////// internal NamespaceExpr( BuiltInExpr bltInExpr ) { _namespaceAlias = null; Identifier aliasId = bltInExpr.Arg1 as Identifier; if (null == aliasId) { throw EntityUtil.EntitySqlError(bltInExpr.Arg1.ErrCtx, System.Data.Entity.Strings.InvalidNamespaceAlias); } if (aliasId.IsEscaped) { throw EntityUtil.EntitySqlError(aliasId.ErrCtx.QueryText, System.Data.Entity.Strings.InvalidEscapedNamespaceAlias, aliasId.ErrCtx.InputPosition); } _namespaceAlias = aliasId; if (bltInExpr.Arg2 is Identifier) { _namespaceName = new DottedIdentifier((Identifier)bltInExpr.Arg2); } else if (bltInExpr.Arg2 is DotExpr) { DotExpr dotExpr = (DotExpr)bltInExpr.Arg2; if (!dotExpr.IsDottedIdentifier) { throw EntityUtil.EntitySqlError(dotExpr.ErrCtx, System.Data.Entity.Strings.InvalidNamespace); } _namespaceName = new DottedIdentifier(dotExpr); } else { throw EntityUtil.EntitySqlError(bltInExpr.ErrCtx, System.Data.Entity.Strings.InvalidNamespace); } } ////// /// returns ns alias id if exists /// internal Identifier AliasIdentifier { get { return _namespaceAlias; } } ////// returns namespace dotted id /// internal DottedIdentifier NamespaceName { get { return _namespaceName; } } ////// returns true if ns is aliased /// internal bool IsAliased { get { return (null != _namespaceAlias); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] [....] //--------------------------------------------------------------------- namespace System.Data.Common.EntitySql { using System; using System.Globalization; using System.Collections; using System.Collections.Generic; ////// represents an ast node for namespace declaration /// internal sealed class NamespaceExpr : Expr { private Identifier _namespaceAlias; private DottedIdentifier _namespaceName; ////// initializes ns as single id /// /// internal NamespaceExpr( Identifier identifier ) { _namespaceName = new DottedIdentifier(identifier); } ////// initializes ns as a dotted id /// /// internal NamespaceExpr( DotExpr dotExpr ) { if (!dotExpr.IsDottedIdentifier) { throw EntityUtil.EntitySqlError(dotExpr.ErrCtx, System.Data.Entity.Strings.InvalidNamespace); } _namespaceName = new DottedIdentifier(dotExpr); } ////// initializes aliased ns /// /// ////// internal NamespaceExpr( BuiltInExpr bltInExpr ) { _namespaceAlias = null; Identifier aliasId = bltInExpr.Arg1 as Identifier; if (null == aliasId) { throw EntityUtil.EntitySqlError(bltInExpr.Arg1.ErrCtx, System.Data.Entity.Strings.InvalidNamespaceAlias); } if (aliasId.IsEscaped) { throw EntityUtil.EntitySqlError(aliasId.ErrCtx.QueryText, System.Data.Entity.Strings.InvalidEscapedNamespaceAlias, aliasId.ErrCtx.InputPosition); } _namespaceAlias = aliasId; if (bltInExpr.Arg2 is Identifier) { _namespaceName = new DottedIdentifier((Identifier)bltInExpr.Arg2); } else if (bltInExpr.Arg2 is DotExpr) { DotExpr dotExpr = (DotExpr)bltInExpr.Arg2; if (!dotExpr.IsDottedIdentifier) { throw EntityUtil.EntitySqlError(dotExpr.ErrCtx, System.Data.Entity.Strings.InvalidNamespace); } _namespaceName = new DottedIdentifier(dotExpr); } else { throw EntityUtil.EntitySqlError(bltInExpr.ErrCtx, System.Data.Entity.Strings.InvalidNamespace); } } ////// /// returns ns alias id if exists /// internal Identifier AliasIdentifier { get { return _namespaceAlias; } } ////// returns namespace dotted id /// internal DottedIdentifier NamespaceName { get { return _namespaceName; } } ////// returns true if ns is aliased /// internal bool IsAliased { get { return (null != _namespaceAlias); } } } } // 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
- ObjectReferenceStack.cs
- Command.cs
- DrawingState.cs
- ListItemCollection.cs
- EdmTypeAttribute.cs
- State.cs
- ClrProviderManifest.cs
- RightsManagementProvider.cs
- HiddenFieldPageStatePersister.cs
- StorageMappingItemCollection.cs
- RuleRef.cs
- ContentDefinition.cs
- PropertyEmitterBase.cs
- EventSourceCreationData.cs
- IntPtr.cs
- DesignerView.xaml.cs
- Vector.cs
- ScriptingSectionGroup.cs
- MouseButtonEventArgs.cs
- DateTimeParse.cs
- DefaultAssemblyResolver.cs
- StateFinalizationDesigner.cs
- WriterOutput.cs
- PropertyGeneratedEventArgs.cs
- TextMetrics.cs
- InstanceHandle.cs
- ProviderConnectionPoint.cs
- FreeFormDragDropManager.cs
- GlobalProxySelection.cs
- Image.cs
- NativeCppClassAttribute.cs
- DispatcherEventArgs.cs
- ObjectView.cs
- ColorConvertedBitmapExtension.cs
- SystemIcmpV4Statistics.cs
- DBDataPermission.cs
- COM2ComponentEditor.cs
- dtdvalidator.cs
- URL.cs
- ChameleonKey.cs
- SingleTagSectionHandler.cs
- MediaTimeline.cs
- JulianCalendar.cs
- Parsers.cs
- JpegBitmapEncoder.cs
- OleDbParameterCollection.cs
- FixedPosition.cs
- RegistrationServices.cs
- HttpCookie.cs
- Mappings.cs
- SystemIPInterfaceStatistics.cs
- PartialArray.cs
- XmlFormatReaderGenerator.cs
- ParameterCollectionEditor.cs
- ComponentChangingEvent.cs
- TemplateColumn.cs
- Command.cs
- Line.cs
- _CommandStream.cs
- DataObject.cs
- RightsManagementLicense.cs
- TemplatedMailWebEventProvider.cs
- EventOpcode.cs
- GroupStyle.cs
- StylusEventArgs.cs
- PackageDigitalSignatureManager.cs
- ReversePositionQuery.cs
- SerialPort.cs
- QueryCacheKey.cs
- GroupQuery.cs
- PathParser.cs
- OdbcCommandBuilder.cs
- DetailsViewInsertEventArgs.cs
- AtomicFile.cs
- Models.cs
- CssClassPropertyAttribute.cs
- DataBinder.cs
- KeyedCollection.cs
- XmlCDATASection.cs
- DBCSCodePageEncoding.cs
- AlphabeticalEnumConverter.cs
- LayoutEvent.cs
- SHA512CryptoServiceProvider.cs
- ObjectListCommandsPage.cs
- Timeline.cs
- GenericTypeParameterConverter.cs
- DefaultSettingsSection.cs
- XmlTextReader.cs
- XhtmlConformanceSection.cs
- processwaithandle.cs
- MembershipSection.cs
- DiscardableAttribute.cs
- BlurBitmapEffect.cs
- UIElementAutomationPeer.cs
- MissingMethodException.cs
- CompilerGeneratedAttribute.cs
- StoreItemCollection.cs
- SafeWaitHandle.cs
- CodeStatementCollection.cs
- OutputChannel.cs