Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Common / EntitySql / NamespaceExpr.cs / 3 / 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
- Int32Storage.cs
- ExpressionConverter.cs
- EpmContentDeSerializer.cs
- FlowNode.cs
- AssertHelper.cs
- SymbolResolver.cs
- XmlDocument.cs
- TextCompositionManager.cs
- SecurityToken.cs
- UnknownBitmapEncoder.cs
- CrossContextChannel.cs
- UriParserTemplates.cs
- _NegotiateClient.cs
- CheckBoxFlatAdapter.cs
- MouseOverProperty.cs
- RoleGroupCollection.cs
- ForeignKeyConstraint.cs
- RecognizerBase.cs
- Int32RectConverter.cs
- SocketInformation.cs
- PreservationFileReader.cs
- COM2FontConverter.cs
- Utils.cs
- DbUpdateCommandTree.cs
- rsa.cs
- NullableDoubleAverageAggregationOperator.cs
- HtmlTableRow.cs
- SizeLimitedCache.cs
- DeferrableContentConverter.cs
- Vector3DAnimationUsingKeyFrames.cs
- BroadcastEventHelper.cs
- TreeIterators.cs
- DatatypeImplementation.cs
- ListViewUpdateEventArgs.cs
- _NegoState.cs
- RepeaterCommandEventArgs.cs
- LineProperties.cs
- MsmqIntegrationInputChannel.cs
- MissingMethodException.cs
- DataGridViewColumnCollectionEditor.cs
- XmlNullResolver.cs
- HttpRequestTraceRecord.cs
- CryptoConfig.cs
- EntityCommand.cs
- BaseDataBoundControl.cs
- DbSourceCommand.cs
- HwndMouseInputProvider.cs
- EmptyEnumerator.cs
- ApplicationActivator.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- EditorZone.cs
- ReferenceSchema.cs
- PathFigureCollectionConverter.cs
- GregorianCalendar.cs
- nulltextnavigator.cs
- OAVariantLib.cs
- NameValueConfigurationCollection.cs
- FramingEncoders.cs
- TimeoutTimer.cs
- OdbcTransaction.cs
- PropertyNames.cs
- DataGridViewRowConverter.cs
- Selection.cs
- DataServiceExpressionVisitor.cs
- Authorization.cs
- MethodCallConverter.cs
- XmlSerializerAssemblyAttribute.cs
- EntityDataSourceValidationException.cs
- PersonalizationStateInfoCollection.cs
- FileRecordSequenceCompletedAsyncResult.cs
- ResourceFallbackManager.cs
- ObjRef.cs
- SqlExpressionNullability.cs
- XPathParser.cs
- ComponentDispatcherThread.cs
- Privilege.cs
- GenericNameHandler.cs
- UnsafeNativeMethods.cs
- XmlFormatExtensionPointAttribute.cs
- FontWeights.cs
- Visual.cs
- DbParameterCollectionHelper.cs
- FontNamesConverter.cs
- ElementFactory.cs
- WasHttpHandlersInstallComponent.cs
- ReaderOutput.cs
- CompensatableTransactionScopeActivityDesigner.cs
- WorkflowPageSetupDialog.cs
- IndentTextWriter.cs
- QuaternionValueSerializer.cs
- SiteOfOriginContainer.cs
- VectorKeyFrameCollection.cs
- PersianCalendar.cs
- DataServiceEntityAttribute.cs
- HatchBrush.cs
- Int64.cs
- StateBag.cs
- WebPartEditorOkVerb.cs
- CancellationScope.cs
- BindValidator.cs