Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Common / EntitySql / AST / Identifier.cs / 1305376 / Identifier.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- namespace System.Data.Common.EntitySql.AST { using System; using System.Globalization; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Text; ////// Represents an identifier ast node. /// internal sealed class Identifier : Node { private readonly string _name; private readonly bool _isEscaped; ////// Initializes identifier. /// internal Identifier(string symbol, bool isEscaped, string query, int inputPos) : base(query, inputPos) { Debug.Assert(!String.IsNullOrEmpty(symbol), "symbol must not be null or empty"); string name = symbol; if (isEscaped) { if (name.Length < 2 || name[0] != '[' || name[name.Length - 1] != ']') { throw EntityUtil.EntitySqlError(this.ErrCtx, System.Data.Entity.Strings.InvalidEscapedIdentifier(name)); } name = name.Substring(1, name.Length - 2); } else { bool isIdentifierASCII = true; if (!CqlLexer.IsLetterOrDigitOrUnderscore(name, out isIdentifierASCII)) { if (isIdentifierASCII) { throw EntityUtil.EntitySqlError(this.ErrCtx, System.Data.Entity.Strings.InvalidSimpleIdentifier(name)); } else { throw EntityUtil.EntitySqlError(this.ErrCtx, System.Data.Entity.Strings.InvalidSimpleIdentifierNonASCII(name)); } } } _name = name; _isEscaped = isEscaped; } ////// Returns identifier name (without escaping chars). /// internal string Name { get { return _name; } } ////// True if an identifier is escaped. /// internal bool IsEscaped { get { return _isEscaped; } } } } // 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
- DataBindingHandlerAttribute.cs
- AutomationProperties.cs
- XmlDataSourceNodeDescriptor.cs
- CodeSubDirectoriesCollection.cs
- SqlFlattener.cs
- IPAddress.cs
- NumberSubstitution.cs
- MaterialCollection.cs
- ScrollContentPresenter.cs
- AstTree.cs
- UIElementHelper.cs
- OutputChannelBinder.cs
- SmtpReplyReaderFactory.cs
- UnaryNode.cs
- ToolStripMenuItem.cs
- CheckBox.cs
- FilterQueryOptionExpression.cs
- GlobalItem.cs
- SerializationBinder.cs
- IISUnsafeMethods.cs
- counter.cs
- UidManager.cs
- SHA384Managed.cs
- NumberFormatInfo.cs
- ObjectStateFormatter.cs
- ListViewHitTestInfo.cs
- OneOfTypeConst.cs
- DashStyles.cs
- ProxyHwnd.cs
- SecureConversationVersion.cs
- AppModelKnownContentFactory.cs
- StretchValidation.cs
- PageContent.cs
- MenuItemCollection.cs
- HMAC.cs
- ReaderWriterLockWrapper.cs
- TreeNodeBindingCollection.cs
- DependencyPropertyChangedEventArgs.cs
- AudioLevelUpdatedEventArgs.cs
- FileFormatException.cs
- Process.cs
- TcpDuplicateContext.cs
- Typeface.cs
- ServicePointManagerElement.cs
- EventArgs.cs
- AttributeCollection.cs
- CodeArgumentReferenceExpression.cs
- DebuggerAttributes.cs
- ContractAdapter.cs
- MatrixAnimationUsingPath.cs
- ClientSettingsStore.cs
- XmlRootAttribute.cs
- SkewTransform.cs
- Size3DConverter.cs
- TdsParserSafeHandles.cs
- CodeObject.cs
- TrailingSpaceComparer.cs
- HandleValueEditor.cs
- PropertyChangingEventArgs.cs
- cookie.cs
- ResolveNextArgumentWorkItem.cs
- Triangle.cs
- OptionUsage.cs
- InheritanceContextHelper.cs
- StateWorkerRequest.cs
- GridItem.cs
- StrokeNode.cs
- PersonalizationStateQuery.cs
- TypefaceMap.cs
- GridViewColumnCollectionChangedEventArgs.cs
- lengthconverter.cs
- ModuleConfigurationInfo.cs
- CodeValidator.cs
- M3DUtil.cs
- ColorInterpolationModeValidation.cs
- IIS7UserPrincipal.cs
- SqlExpander.cs
- MaskedTextBox.cs
- SerializationInfo.cs
- Coordinator.cs
- SqlInternalConnection.cs
- PageSettings.cs
- dbenumerator.cs
- ComponentCache.cs
- SerializationObjectManager.cs
- IndependentlyAnimatedPropertyMetadata.cs
- DbParameterCollection.cs
- BaseUriWithWildcard.cs
- XpsFilter.cs
- RotateTransform3D.cs
- PngBitmapDecoder.cs
- BinaryUtilClasses.cs
- QilDataSource.cs
- ErrorStyle.cs
- XPathNavigator.cs
- SiteMapNodeItemEventArgs.cs
- FormViewDesigner.cs
- _DomainName.cs
- UserControlBuildProvider.cs
- SqlDataSourceQueryEditorForm.cs