Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / Odbc / OdbcConnectionString.cs / 1305376 / OdbcConnectionString.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.Odbc { using System; using System.Collections; using System.Data; using System.Data.Common; using System.Security; using System.Security.Permissions; using System.Text; internal sealed class OdbcConnectionString : DbConnectionOptions { // instances of this class are intended to be immutable, i.e readonly // used by pooling classes so it is much easier to verify correctness // when not worried about the class being modified during execution private static class KEY { internal const string SaveFile = "savefile"; } private readonly string _expandedConnectionString; internal OdbcConnectionString(string connectionString, bool validate) : base(connectionString, null, true) { if (!validate) { string filename = null; int position = 0; _expandedConnectionString = ExpandDataDirectories(ref filename, ref position); } if (validate || (null == _expandedConnectionString)) { // do not check string length if it was expanded because the final result may be shorter than the original if ((null != connectionString) && (ODBC32.MAX_CONNECTION_STRING_LENGTH < connectionString.Length)) { // MDAC 83536 throw ODBC.ConnectionStringTooLong(); } } } protected internal override System.Security.PermissionSet CreatePermissionSet() { System.Security.PermissionSet permissionSet; if (ContainsKey(KEY.SaveFile)) { permissionSet = new NamedPermissionSet("FullTrust"); } else { permissionSet = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.None); permissionSet.AddPermission(new OdbcPermission(this)); } return permissionSet; } protected internal override string Expand() { if (null != _expandedConnectionString) { return _expandedConnectionString; } else { return base.Expand(); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.Odbc { using System; using System.Collections; using System.Data; using System.Data.Common; using System.Security; using System.Security.Permissions; using System.Text; internal sealed class OdbcConnectionString : DbConnectionOptions { // instances of this class are intended to be immutable, i.e readonly // used by pooling classes so it is much easier to verify correctness // when not worried about the class being modified during execution private static class KEY { internal const string SaveFile = "savefile"; } private readonly string _expandedConnectionString; internal OdbcConnectionString(string connectionString, bool validate) : base(connectionString, null, true) { if (!validate) { string filename = null; int position = 0; _expandedConnectionString = ExpandDataDirectories(ref filename, ref position); } if (validate || (null == _expandedConnectionString)) { // do not check string length if it was expanded because the final result may be shorter than the original if ((null != connectionString) && (ODBC32.MAX_CONNECTION_STRING_LENGTH < connectionString.Length)) { // MDAC 83536 throw ODBC.ConnectionStringTooLong(); } } } protected internal override System.Security.PermissionSet CreatePermissionSet() { System.Security.PermissionSet permissionSet; if (ContainsKey(KEY.SaveFile)) { permissionSet = new NamedPermissionSet("FullTrust"); } else { permissionSet = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.None); permissionSet.AddPermission(new OdbcPermission(this)); } return permissionSet; } protected internal override string Expand() { if (null != _expandedConnectionString) { return _expandedConnectionString; } else { return base.Expand(); } } } } // 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
- RSAProtectedConfigurationProvider.cs
- SafeRegistryHandle.cs
- WaveHeader.cs
- TransactionTable.cs
- ErrorFormatter.cs
- ObjectDataSourceView.cs
- PlainXmlSerializer.cs
- DomainUpDown.cs
- RSACryptoServiceProvider.cs
- TypeSystem.cs
- UIPermission.cs
- GlobalizationSection.cs
- ReadOnlyAttribute.cs
- CompilerTypeWithParams.cs
- ExtensionDataReader.cs
- SystemWebCachingSectionGroup.cs
- StyleBamlRecordReader.cs
- DesignerEventService.cs
- DirectoryNotFoundException.cs
- XmlChildEnumerator.cs
- EastAsianLunisolarCalendar.cs
- CountdownEvent.cs
- CustomAttributeBuilder.cs
- SafeProcessHandle.cs
- MatrixUtil.cs
- XmlWriter.cs
- ThousandthOfEmRealPoints.cs
- WSHttpBindingCollectionElement.cs
- TargetConverter.cs
- UriExt.cs
- RetriableClipboard.cs
- NullableDecimalAverageAggregationOperator.cs
- ContextMenuStrip.cs
- ProcessThreadCollection.cs
- WinEventWrap.cs
- InputProcessorProfiles.cs
- NameSpaceExtractor.cs
- EventBuilder.cs
- DataListItemCollection.cs
- HitTestFilterBehavior.cs
- baseshape.cs
- XmlSchema.cs
- ToolStrip.cs
- TemplateNameScope.cs
- HeaderCollection.cs
- PasswordRecovery.cs
- XmlSchemaGroupRef.cs
- GeneralTransform2DTo3D.cs
- UpdateExpressionVisitor.cs
- ColorAnimation.cs
- OdbcInfoMessageEvent.cs
- MenuStrip.cs
- RegexGroup.cs
- MachineKeyConverter.cs
- WebPartConnectVerb.cs
- TextContainerChangeEventArgs.cs
- MenuItemAutomationPeer.cs
- PrintController.cs
- FixedSOMContainer.cs
- ServiceOperationParameter.cs
- TextReader.cs
- ManifestSignatureInformation.cs
- ResXResourceWriter.cs
- CubicEase.cs
- EntityDataSourceStatementEditorForm.cs
- SizeValueSerializer.cs
- SHA384.cs
- XmlRawWriter.cs
- ArrayList.cs
- BitmapEffectRenderDataResource.cs
- Activator.cs
- OutputCacheModule.cs
- SmtpClient.cs
- NotificationContext.cs
- SubstitutionResponseElement.cs
- RtfControls.cs
- SelectedDatesCollection.cs
- PEFileReader.cs
- DeflateEmulationStream.cs
- Random.cs
- TraceRecord.cs
- DesignerCommandAdapter.cs
- DetailsViewCommandEventArgs.cs
- ArraySegment.cs
- InternalDispatchObject.cs
- DesignTimeSiteMapProvider.cs
- RawAppCommandInputReport.cs
- NonBatchDirectoryCompiler.cs
- OracleInternalConnection.cs
- DbDataAdapter.cs
- XamlTypeMapper.cs
- SafePointer.cs
- ToolboxComponentsCreatingEventArgs.cs
- QilParameter.cs
- CellParagraph.cs
- Decimal.cs
- InvokeProviderWrapper.cs
- MimeTypeMapper.cs
- XPathQilFactory.cs
- DbFunctionCommandTree.cs