Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Common / EntitySql / NamespaceExpr.cs / 1 / 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
- CharUnicodeInfo.cs
- DecoderFallback.cs
- GraphicsPathIterator.cs
- DrawingAttributesDefaultValueFactory.cs
- TriggerAction.cs
- StreamWriter.cs
- DataGridViewCellParsingEventArgs.cs
- MachineKeySection.cs
- FileUtil.cs
- TemplateKeyConverter.cs
- CryptoConfig.cs
- WithStatement.cs
- ServiceX509SecurityTokenProvider.cs
- DetailsView.cs
- Color.cs
- XmlValidatingReaderImpl.cs
- RequestCacheManager.cs
- XPathDocumentIterator.cs
- CommandManager.cs
- HelloMessage11.cs
- RawTextInputReport.cs
- Soap.cs
- IsolatedStorageFilePermission.cs
- PropertyGridCommands.cs
- PlanCompiler.cs
- RequestCachingSection.cs
- CodeMemberMethod.cs
- PolyQuadraticBezierSegment.cs
- DataControlPagerLinkButton.cs
- DebugView.cs
- DataGridViewCellCancelEventArgs.cs
- SafeReversePInvokeHandle.cs
- DisplayToken.cs
- DataGridViewDataErrorEventArgs.cs
- CodeIdentifier.cs
- XhtmlBasicValidatorAdapter.cs
- CodeBlockBuilder.cs
- SectionXmlInfo.cs
- ListQueryResults.cs
- RectAnimation.cs
- ConstructorBuilder.cs
- WindowsFormsSynchronizationContext.cs
- RealProxy.cs
- AnnotationHelper.cs
- SigningProgress.cs
- ControlValuePropertyAttribute.cs
- MetadataArtifactLoaderCompositeResource.cs
- LogicalCallContext.cs
- ItemCheckEvent.cs
- AccessorTable.cs
- Label.cs
- TabControlCancelEvent.cs
- WorkflowInstanceAbortedRecord.cs
- UserNameSecurityTokenAuthenticator.cs
- _FixedSizeReader.cs
- ApplicationSecurityInfo.cs
- UrlSyndicationContent.cs
- TypeUsage.cs
- xml.cs
- BufferedStream.cs
- TranslateTransform3D.cs
- RightsManagementEncryptedStream.cs
- AnnotationAuthorChangedEventArgs.cs
- VerticalAlignConverter.cs
- OleDbParameter.cs
- WsatProxy.cs
- SqlCharStream.cs
- CombinedGeometry.cs
- QuadraticBezierSegment.cs
- _NegotiateClient.cs
- FormatVersion.cs
- InputBinder.cs
- ControlParameter.cs
- Timer.cs
- CachedFontFamily.cs
- PerspectiveCamera.cs
- SaveFileDialog.cs
- CacheSection.cs
- WindowsComboBox.cs
- SHA512.cs
- SingleAnimationUsingKeyFrames.cs
- TaskHelper.cs
- Rule.cs
- InternalConfigHost.cs
- DataListItemEventArgs.cs
- PagerSettings.cs
- HostingEnvironmentSection.cs
- BigInt.cs
- SafeEventHandle.cs
- SQLSingle.cs
- DeviceContext.cs
- Matrix.cs
- ItemsControl.cs
- WebPartTransformer.cs
- HttpListenerRequestUriBuilder.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- XmlNodeReader.cs
- Decoder.cs
- OracleCommand.cs
- Vector3DAnimationUsingKeyFrames.cs