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
- DesignerView.Commands.cs
- SchemaMerger.cs
- CodeConstructor.cs
- Aes.cs
- VirtualDirectoryMapping.cs
- MeshGeometry3D.cs
- ContextConfiguration.cs
- QueryCoreOp.cs
- AmbientLight.cs
- InvokeMethodDesigner.xaml.cs
- ModelItemDictionaryImpl.cs
- UnicodeEncoding.cs
- Stream.cs
- SqlClientMetaDataCollectionNames.cs
- SolidColorBrush.cs
- ApplicationId.cs
- DefaultDialogButtons.cs
- ReadWriteControlDesigner.cs
- RadioButtonList.cs
- MasterPageParser.cs
- UIElement.cs
- AsyncPostBackTrigger.cs
- DecoratedNameAttribute.cs
- OLEDB_Util.cs
- WinEventHandler.cs
- TabPanel.cs
- ProviderSettingsCollection.cs
- TextTreeRootNode.cs
- ToolbarAUtomationPeer.cs
- HtmlTableRowCollection.cs
- DefaultTextStore.cs
- TreeNode.cs
- RecognizeCompletedEventArgs.cs
- AccessorTable.cs
- LineServicesCallbacks.cs
- AspProxy.cs
- CustomAttribute.cs
- WebPermission.cs
- webeventbuffer.cs
- GPRECTF.cs
- LayoutInformation.cs
- NotCondition.cs
- ToolStripItemRenderEventArgs.cs
- ParseChildrenAsPropertiesAttribute.cs
- DbRetry.cs
- LineMetrics.cs
- XPathNodeIterator.cs
- BoundingRectTracker.cs
- HostingEnvironmentWrapper.cs
- BitmapMetadataBlob.cs
- CmsInterop.cs
- ColorPalette.cs
- QueryRelOp.cs
- RuleInfoComparer.cs
- UmAlQuraCalendar.cs
- CodeArgumentReferenceExpression.cs
- EdmRelationshipRoleAttribute.cs
- Grammar.cs
- XmlNavigatorFilter.cs
- CalendarKeyboardHelper.cs
- TdsParserHelperClasses.cs
- ClientTargetSection.cs
- HwndTarget.cs
- SerialPort.cs
- DataBoundControl.cs
- EnterpriseServicesHelper.cs
- ApplyTemplatesAction.cs
- ServiceProviders.cs
- PropertyPushdownHelper.cs
- DrawingAttributes.cs
- TextAutomationPeer.cs
- ProfileService.cs
- PageSetupDialog.cs
- DataGridSortCommandEventArgs.cs
- CodeIterationStatement.cs
- SplayTreeNode.cs
- SHA1Cng.cs
- SqlConnectionPoolGroupProviderInfo.cs
- EditingContext.cs
- AutomationProperty.cs
- DataTableExtensions.cs
- StretchValidation.cs
- AuthStoreRoleProvider.cs
- xdrvalidator.cs
- SByteStorage.cs
- CachedFontFace.cs
- SerializationSectionGroup.cs
- EntityDataSourceValidationException.cs
- XmlReflectionMember.cs
- ResourceExpressionBuilder.cs
- WebPartCancelEventArgs.cs
- Utils.cs
- EntityContainerAssociationSetEnd.cs
- httpapplicationstate.cs
- ObjectListSelectEventArgs.cs
- ConfigurationSettings.cs
- SwitchElementsCollection.cs
- MimeWriter.cs
- SQLStringStorage.cs
- HTMLTextWriter.cs