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
- ApplicationBuildProvider.cs
- GradientStopCollection.cs
- EntityDesignPluralizationHandler.cs
- ManagementInstaller.cs
- EventPrivateKey.cs
- ResourceSet.cs
- TogglePattern.cs
- ProfileEventArgs.cs
- XmlSchemaChoice.cs
- RuntimeArgumentHandle.cs
- RenderCapability.cs
- SqlDataSourceQueryConverter.cs
- SQLSingle.cs
- DataGridViewCellStateChangedEventArgs.cs
- ContentIterators.cs
- ManagementObjectSearcher.cs
- TraceHwndHost.cs
- RecipientInfo.cs
- BaseConfigurationRecord.cs
- EdmProperty.cs
- ToolStripOverflowButton.cs
- HyperLinkColumn.cs
- WebInvokeAttribute.cs
- _NetworkingPerfCounters.cs
- DecodeHelper.cs
- RtfControlWordInfo.cs
- StsCommunicationException.cs
- SecurityKeyIdentifierClause.cs
- ProcessInfo.cs
- XmlSchemaSimpleContentRestriction.cs
- SurrogateChar.cs
- SynchronizationValidator.cs
- TextRunCache.cs
- ThreadPool.cs
- keycontainerpermission.cs
- DesignerCommandSet.cs
- SyndicationSerializer.cs
- HtmlSelect.cs
- EventsTab.cs
- WebPartEditVerb.cs
- ReferenceAssemblyAttribute.cs
- Glyph.cs
- RoutedUICommand.cs
- ChangeNode.cs
- SqlConnectionString.cs
- ReferenceTypeElement.cs
- DataTableReaderListener.cs
- ApplicationException.cs
- WebEventTraceProvider.cs
- DataError.cs
- ComplexType.cs
- XmlIncludeAttribute.cs
- SqlTriggerAttribute.cs
- GraphicsState.cs
- ScalarOps.cs
- SqlDataRecord.cs
- ChannelManager.cs
- XmlSerializerAssemblyAttribute.cs
- RTLAwareMessageBox.cs
- AngleUtil.cs
- XPathNode.cs
- IsolationInterop.cs
- SpeechSeg.cs
- ListBindingConverter.cs
- UserValidatedEventArgs.cs
- InkPresenter.cs
- LayoutSettings.cs
- TextFindEngine.cs
- UnsafeNativeMethodsMilCoreApi.cs
- ScriptReferenceBase.cs
- ReceiveSecurityHeaderEntry.cs
- TabControlEvent.cs
- TextBox.cs
- MulticastDelegate.cs
- FilteredAttributeCollection.cs
- BinaryMessageEncodingElement.cs
- AssemblyName.cs
- PrimitiveList.cs
- GB18030Encoding.cs
- MatrixConverter.cs
- DataRelation.cs
- SqlProvider.cs
- OleDbParameterCollection.cs
- SiteMapDataSourceView.cs
- EntityWithKeyStrategy.cs
- TransferMode.cs
- EntityParameter.cs
- ADRoleFactoryConfiguration.cs
- TextContainerHelper.cs
- PassportAuthenticationEventArgs.cs
- LongPath.cs
- DataGridDesigner.cs
- RadioButtonFlatAdapter.cs
- HyperLinkField.cs
- HitTestParameters.cs
- _emptywebproxy.cs
- SqlGatherConsumedAliases.cs
- UnsafeNativeMethods.cs
- CheckBoxFlatAdapter.cs
- DesignTableCollection.cs