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
- Part.cs
- TreeViewBindingsEditorForm.cs
- UpdatePanelTrigger.cs
- PolyLineSegment.cs
- LinearKeyFrames.cs
- BinarySerializer.cs
- FeatureSupport.cs
- QueryAccessibilityHelpEvent.cs
- TargetInvocationException.cs
- FocusChangedEventArgs.cs
- BaseValidator.cs
- RelatedPropertyManager.cs
- UnsafeNativeMethodsCLR.cs
- CachedFontFamily.cs
- Context.cs
- StreamResourceInfo.cs
- SystemResources.cs
- ColorBlend.cs
- FormViewUpdatedEventArgs.cs
- FixedDocument.cs
- HttpCookiesSection.cs
- Stack.cs
- SeekStoryboard.cs
- HwndKeyboardInputProvider.cs
- UserInitiatedRoutedEventPermission.cs
- BufferedGraphicsContext.cs
- QueueException.cs
- OptionalColumn.cs
- VoiceSynthesis.cs
- CertificateManager.cs
- RepeaterItem.cs
- WebPartEditVerb.cs
- DomNameTable.cs
- CodeDOMProvider.cs
- _NTAuthentication.cs
- ToolTipAutomationPeer.cs
- FormattedTextSymbols.cs
- PersonalizationStateInfo.cs
- WorkflowMarkupElementEventArgs.cs
- XpsPartBase.cs
- ServiceDescriptionReflector.cs
- UdpMessageProperty.cs
- TextDecorations.cs
- Funcletizer.cs
- Vector3DCollection.cs
- Boolean.cs
- CipherData.cs
- MenuItemBindingCollection.cs
- ErrorStyle.cs
- ApplicationActivator.cs
- OutOfMemoryException.cs
- COM2PictureConverter.cs
- TypeResolvingOptionsAttribute.cs
- XsdDataContractImporter.cs
- LoginName.cs
- ActivityDesignerAccessibleObject.cs
- UserControlBuildProvider.cs
- AccessedThroughPropertyAttribute.cs
- RelativeSource.cs
- UnsafeNativeMethods.cs
- DeviceContext.cs
- PieceDirectory.cs
- SystemResources.cs
- InputChannel.cs
- RequiredAttributeAttribute.cs
- FontUnitConverter.cs
- FontStretch.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- DoubleKeyFrameCollection.cs
- HtmlCalendarAdapter.cs
- CreateWorkflowOwnerCommand.cs
- DataGridHeaderBorder.cs
- HttpWebResponse.cs
- PointConverter.cs
- DelimitedListTraceListener.cs
- LocalValueEnumerator.cs
- OleDbReferenceCollection.cs
- SmtpLoginAuthenticationModule.cs
- ModelTreeEnumerator.cs
- AudioLevelUpdatedEventArgs.cs
- ParserStack.cs
- SynchronizationValidator.cs
- DataPointer.cs
- GridView.cs
- ValidationEventArgs.cs
- SmtpNtlmAuthenticationModule.cs
- GenericTypeParameterBuilder.cs
- BindingNavigator.cs
- FactoryId.cs
- GridLengthConverter.cs
- XmlSerializerSection.cs
- SelectionListDesigner.cs
- BaseProcessor.cs
- ListViewInsertEventArgs.cs
- PathGeometry.cs
- DataStreamFromComStream.cs
- LinearQuaternionKeyFrame.cs
- ClassHandlersStore.cs
- NullableBoolConverter.cs
- LineMetrics.cs