Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Common / EntitySql / ParserOptions.cs / 1305376 / ParserOptions.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
{
using System;
using System.Globalization;
//
// disables XML doc overloads warning as error
//
#pragma warning disable 0419
///
/// Represents eSQL Text Compilation options.
/// ParserOptions can be optionaly passed to CqlQuery.Compile or CqlQuery.Parse methods
///
///
/// Thrown if the properties are changed after being consumed by CqlQuery.Parse or CqlQuery.Compile
///
/// Once ParserOptions is passed and consumed by Compile or Parse Methods, it cannot be changed.
/// If a setter is called after a ParserOptions instance is consumed by Parse or Compile methods, a EntityException will be raised.
///
/// Compile Method
/// Parse Method
///
internal sealed class ParserOptions
{
///
/// Makes options read-only
///
///
internal ParserOptions MakeReadOnly()
{
_bReadOnly = true;
return this;
}
private bool _bReadOnly = false;
internal enum CompilationMode
{
///
/// Normal mode. Compiles eSQL command without restrictions.
///
NormalMode,
///
/// View generation mode: optimizes compilation process to ignore uncessary eSQL constructs:
/// - GROUP BY, HAVING and ORDER BY clauses are ignored.
/// - WITH RELATIONSHIP clause is allowed in type constructors.
///
RestrictedViewGenerationMode,
///
/// Same as CompilationMode.Normal plus WITH RELATIONSHIP clause is allowed in type constructors.
///
UserViewGenerationMode
}
///
/// Sets/Gets eSQL parser compilation mode.
///
internal CompilationMode ParserCompilationMode
{
get
{
return _compilationMode;
}
set
{
CheckIfReadOnly();
_compilationMode = value;
}
}
private CompilationMode _compilationMode = CompilationMode.NormalMode;
///
/// Verify if setters are allowed.
///
private void CheckIfReadOnly()
{
if (_bReadOnly)
{
throw EntityUtil.EntitySqlError(System.Data.Entity.Strings.PropertyCannotBeChangedAtThisTime);
}
}
}
#pragma warning restore 0419
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
{
using System;
using System.Globalization;
//
// disables XML doc overloads warning as error
//
#pragma warning disable 0419
///
/// Represents eSQL Text Compilation options.
/// ParserOptions can be optionaly passed to CqlQuery.Compile or CqlQuery.Parse methods
///
///
/// Thrown if the properties are changed after being consumed by CqlQuery.Parse or CqlQuery.Compile
///
/// Once ParserOptions is passed and consumed by Compile or Parse Methods, it cannot be changed.
/// If a setter is called after a ParserOptions instance is consumed by Parse or Compile methods, a EntityException will be raised.
///
/// Compile Method
/// Parse Method
///
internal sealed class ParserOptions
{
///
/// Makes options read-only
///
///
internal ParserOptions MakeReadOnly()
{
_bReadOnly = true;
return this;
}
private bool _bReadOnly = false;
internal enum CompilationMode
{
///
/// Normal mode. Compiles eSQL command without restrictions.
///
NormalMode,
///
/// View generation mode: optimizes compilation process to ignore uncessary eSQL constructs:
/// - GROUP BY, HAVING and ORDER BY clauses are ignored.
/// - WITH RELATIONSHIP clause is allowed in type constructors.
///
RestrictedViewGenerationMode,
///
/// Same as CompilationMode.Normal plus WITH RELATIONSHIP clause is allowed in type constructors.
///
UserViewGenerationMode
}
///
/// Sets/Gets eSQL parser compilation mode.
///
internal CompilationMode ParserCompilationMode
{
get
{
return _compilationMode;
}
set
{
CheckIfReadOnly();
_compilationMode = value;
}
}
private CompilationMode _compilationMode = CompilationMode.NormalMode;
///
/// Verify if setters are allowed.
///
private void CheckIfReadOnly()
{
if (_bReadOnly)
{
throw EntityUtil.EntitySqlError(System.Data.Entity.Strings.PropertyCannotBeChangedAtThisTime);
}
}
}
#pragma warning restore 0419
}
// 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
- RSAOAEPKeyExchangeDeformatter.cs
- UriTemplateTrieLocation.cs
- SR.cs
- XmlBinaryReader.cs
- RuleInfoComparer.cs
- StringFunctions.cs
- DataGrid.cs
- EventSinkHelperWriter.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- CodeStatementCollection.cs
- SolidColorBrush.cs
- TreeNodeStyleCollectionEditor.cs
- SchemaTypeEmitter.cs
- DocumentOrderQuery.cs
- MethodImplAttribute.cs
- Line.cs
- DataSourceSelectArguments.cs
- DataGridViewCellCancelEventArgs.cs
- Message.cs
- HtmlUtf8RawTextWriter.cs
- DataServiceQueryProvider.cs
- ContentFilePart.cs
- DataSourceXmlSerializer.cs
- QilSortKey.cs
- XPathCompiler.cs
- ConnectionPointCookie.cs
- InheritanceContextHelper.cs
- SqlDependencyListener.cs
- SocketPermission.cs
- WebPartDesigner.cs
- Rect3DConverter.cs
- TemplatedWizardStep.cs
- DSACryptoServiceProvider.cs
- InkCanvas.cs
- _NativeSSPI.cs
- RecognizerInfo.cs
- QuaternionAnimation.cs
- GeometryModel3D.cs
- DispatcherOperation.cs
- FixedPage.cs
- ResourceIDHelper.cs
- CodeTypeMember.cs
- MessageUtil.cs
- TdsParserStateObject.cs
- COM2ColorConverter.cs
- TimeStampChecker.cs
- NetStream.cs
- TaiwanLunisolarCalendar.cs
- WSSecurityOneDotZeroReceiveSecurityHeader.cs
- TemplateEditingVerb.cs
- _HeaderInfoTable.cs
- DataGridViewCellFormattingEventArgs.cs
- UnSafeCharBuffer.cs
- RegexNode.cs
- HtmlLink.cs
- LocalizableResourceBuilder.cs
- MultiAsyncResult.cs
- XmlSchemaAnnotation.cs
- BufferModeSettings.cs
- TransformPattern.cs
- SqlDataAdapter.cs
- CreatingCookieEventArgs.cs
- FontFaceLayoutInfo.cs
- PipelineModuleStepContainer.cs
- TextFormattingConverter.cs
- QuaternionValueSerializer.cs
- CompilationRelaxations.cs
- Vector3D.cs
- ZipIOLocalFileBlock.cs
- ToolStripRenderer.cs
- XPathBuilder.cs
- TraceUtils.cs
- WebSysDescriptionAttribute.cs
- WorkflowValidationFailedException.cs
- ChannelManager.cs
- HybridWebProxyFinder.cs
- SourceFileInfo.cs
- Helper.cs
- OpCodes.cs
- ReturnEventArgs.cs
- TransactionFlowBindingElementImporter.cs
- DoubleStorage.cs
- ManagedWndProcTracker.cs
- SolidColorBrush.cs
- WebPartCloseVerb.cs
- SecurityRuntime.cs
- CatalogZone.cs
- BridgeDataReader.cs
- FilteredXmlReader.cs
- DataSourceXmlAttributeAttribute.cs
- EventLogger.cs
- TypeToStringValueConverter.cs
- TextElement.cs
- TreeNode.cs
- NamedObject.cs
- TextBox.cs
- WebPartCatalogCloseVerb.cs
- WindowPattern.cs
- PassportIdentity.cs
- XmlEnumAttribute.cs