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
- LoadMessageLogger.cs
- ItemsChangedEventArgs.cs
- GeometryCombineModeValidation.cs
- _ConnectionGroup.cs
- FactoryGenerator.cs
- ConnectionProviderAttribute.cs
- SmtpNetworkElement.cs
- CookieProtection.cs
- SqlBulkCopyColumnMapping.cs
- FontFamily.cs
- SqlOuterApplyReducer.cs
- ToolStripMenuItemCodeDomSerializer.cs
- DataPager.cs
- ListBase.cs
- ExpressionBuilderContext.cs
- RequestCacheValidator.cs
- HwndHost.cs
- SubqueryRules.cs
- NativeMethods.cs
- EntityDataSourceChangedEventArgs.cs
- MeasurementDCInfo.cs
- IdentitySection.cs
- MailBnfHelper.cs
- ExpressionBindings.cs
- AssemblyCacheEntry.cs
- DateTimeConstantAttribute.cs
- XmlReflectionImporter.cs
- ImageSource.cs
- VerbConverter.cs
- basenumberconverter.cs
- RunClient.cs
- StylusPointDescription.cs
- PageParserFilter.cs
- AssemblyBuilder.cs
- XmlChildEnumerator.cs
- TemplatedMailWebEventProvider.cs
- ObjectDataSourceEventArgs.cs
- Column.cs
- HttpsChannelListener.cs
- BatchServiceHost.cs
- SymDocumentType.cs
- PermissionSetTriple.cs
- ModifiableIteratorCollection.cs
- SqlGatherProducedAliases.cs
- TextEffect.cs
- FlatButtonAppearance.cs
- AssemblyAttributesGoHere.cs
- RoutingTable.cs
- SqlWebEventProvider.cs
- NumericUpDown.cs
- PartitionerStatic.cs
- CreateSequenceResponse.cs
- SimpleApplicationHost.cs
- RightsManagementSuppressedStream.cs
- BaseTemplateBuildProvider.cs
- Size3DValueSerializer.cs
- elementinformation.cs
- Property.cs
- CultureTable.cs
- TraceHwndHost.cs
- ArrayWithOffset.cs
- UserValidatedEventArgs.cs
- CallbackTimeoutsBehavior.cs
- SafeNativeMethodsOther.cs
- TextureBrush.cs
- ScalarType.cs
- PersonalizationState.cs
- ConvertTextFrag.cs
- SpAudioStreamWrapper.cs
- GridViewUpdatedEventArgs.cs
- DelegatingConfigHost.cs
- DateTimeConstantAttribute.cs
- Identifier.cs
- Listbox.cs
- SetState.cs
- CapacityStreamGeometryContext.cs
- Win32Native.cs
- SymDocumentType.cs
- BitArray.cs
- UnmanagedMemoryStream.cs
- EngineSite.cs
- CodeMemberMethod.cs
- CellPartitioner.cs
- ExpressionBuilder.cs
- ShapeTypeface.cs
- StringAnimationUsingKeyFrames.cs
- WebPartMenuStyle.cs
- CodeCompiler.cs
- ServiceMetadataContractBehavior.cs
- XmlSchemaComplexContentRestriction.cs
- SqlRowUpdatingEvent.cs
- MeasurementDCInfo.cs
- WindowsToolbarItemAsMenuItem.cs
- FontStyle.cs
- ValueType.cs
- LockCookie.cs
- BaseParser.cs
- SortedDictionary.cs
- RuntimeConfigurationRecord.cs
- ServiceDefaults.cs