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
- TrustManagerPromptUI.cs
- InstanceLockQueryResult.cs
- BooleanSwitch.cs
- DateTimeFormat.cs
- Events.cs
- FrameworkObject.cs
- MembershipPasswordException.cs
- InvokeWebService.cs
- IISMapPath.cs
- SqlTriggerContext.cs
- PropertyValueUIItem.cs
- XhtmlMobileTextWriter.cs
- XamlWriter.cs
- Vector3DCollectionConverter.cs
- DocumentReference.cs
- OdbcReferenceCollection.cs
- EmbossBitmapEffect.cs
- Inflater.cs
- InvalidDataContractException.cs
- TreeView.cs
- NavigationPropertyEmitter.cs
- TextTabProperties.cs
- Codec.cs
- EditorZone.cs
- ClientSettings.cs
- PageCatalogPartDesigner.cs
- PropertyBuilder.cs
- Paragraph.cs
- _LocalDataStoreMgr.cs
- UIntPtr.cs
- FloatUtil.cs
- SiteMapDataSourceView.cs
- cookie.cs
- DataSourceHelper.cs
- WebBrowsableAttribute.cs
- CurrentTimeZone.cs
- OdbcConnectionOpen.cs
- ObjectView.cs
- WMIInterop.cs
- UIServiceHelper.cs
- BindingList.cs
- PersonalizablePropertyEntry.cs
- AnnotationAuthorChangedEventArgs.cs
- UpdateEventArgs.cs
- OdbcConnectionString.cs
- XhtmlBasicPhoneCallAdapter.cs
- SpecularMaterial.cs
- InvalidOleVariantTypeException.cs
- MediaElement.cs
- HScrollProperties.cs
- DesignerView.xaml.cs
- AttributedMetaModel.cs
- SessionStateUtil.cs
- ButtonBase.cs
- MediaElement.cs
- LZCodec.cs
- List.cs
- SubclassTypeValidator.cs
- TdsParser.cs
- SqlConnectionPoolProviderInfo.cs
- _KerberosClient.cs
- InstanceCreationEditor.cs
- ExpressionNormalizer.cs
- GridViewCommandEventArgs.cs
- RelationshipType.cs
- InstalledVoice.cs
- BooleanExpr.cs
- EndOfStreamException.cs
- ListViewItemCollectionEditor.cs
- ErrorFormatterPage.cs
- Baml6ConstructorInfo.cs
- EventlogProvider.cs
- MimeFormImporter.cs
- HostedNamedPipeTransportManager.cs
- SqlConnectionPoolProviderInfo.cs
- RenderContext.cs
- DotAtomReader.cs
- IInstanceContextProvider.cs
- DesignTimeData.cs
- TabletDeviceInfo.cs
- ViewCellRelation.cs
- InstanceDataCollectionCollection.cs
- BindingList.cs
- CryptoApi.cs
- RadialGradientBrush.cs
- AutomationElementIdentifiers.cs
- DirectoryInfo.cs
- QueryContinueDragEventArgs.cs
- FormViewDeleteEventArgs.cs
- TypedTableBase.cs
- TreeViewDataItemAutomationPeer.cs
- ToolStripSeparator.cs
- XmlArrayAttribute.cs
- ColorAnimationUsingKeyFrames.cs
- BitmapVisualManager.cs
- UnSafeCharBuffer.cs
- XmlSignatureProperties.cs
- ReachPageContentSerializerAsync.cs
- ReadOnlyNameValueCollection.cs
- SQLInt32Storage.cs