Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Data / System / Data / Odbc / OdbcConnectionString.cs / 1 / 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
- RootBrowserWindowProxy.cs
- StylesEditorDialog.cs
- CqlLexerHelpers.cs
- DataTrigger.cs
- BitmapEffectDrawingContextState.cs
- GuidelineCollection.cs
- DetailsViewInsertEventArgs.cs
- BaseCodePageEncoding.cs
- DataGridViewColumnCollection.cs
- RowUpdatedEventArgs.cs
- FormsAuthenticationTicket.cs
- WebPartMinimizeVerb.cs
- PeerResolver.cs
- SqlDataSourceView.cs
- DnsPermission.cs
- XAMLParseException.cs
- CryptoKeySecurity.cs
- DataGridViewComponentPropertyGridSite.cs
- CompilationSection.cs
- FormsAuthenticationUserCollection.cs
- SecurityUtils.cs
- NonVisualControlAttribute.cs
- FaultDescriptionCollection.cs
- PrtTicket_Editor.cs
- PageHandlerFactory.cs
- FixedDocument.cs
- XmlReaderSettings.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- ResXBuildProvider.cs
- MethodSignatureGenerator.cs
- ExpressionParser.cs
- HostDesigntimeLicenseContext.cs
- MessageQueueInstaller.cs
- SafeRightsManagementEnvironmentHandle.cs
- HttpRequest.cs
- DataGridHeaderBorder.cs
- ThemeDirectoryCompiler.cs
- ScrollItemProviderWrapper.cs
- XPathDocumentNavigator.cs
- XsltQilFactory.cs
- SQLStringStorage.cs
- EdmSchemaAttribute.cs
- MetadataArtifactLoaderCompositeFile.cs
- Rfc4050KeyFormatter.cs
- AuthenticationManager.cs
- ThrowHelper.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- UIElement3D.cs
- HttpCapabilitiesEvaluator.cs
- StorageInfo.cs
- DesignerTransactionCloseEvent.cs
- TransformedBitmap.cs
- WebBrowserBase.cs
- ArrayListCollectionBase.cs
- EntityContainer.cs
- BaseCollection.cs
- SqlClientPermission.cs
- LocalIdCollection.cs
- SAPIEngineTypes.cs
- CalendarDesigner.cs
- UIElement3DAutomationPeer.cs
- TypeBuilder.cs
- SpeechAudioFormatInfo.cs
- DbConnectionPoolOptions.cs
- FamilyTypeface.cs
- CapabilitiesAssignment.cs
- OdbcConnectionHandle.cs
- NamespaceList.cs
- ChangeToolStripParentVerb.cs
- SqlStatistics.cs
- SelectionRange.cs
- Globals.cs
- DataSourceCache.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- CollectionBuilder.cs
- ExpressionEditorAttribute.cs
- DelayedRegex.cs
- ActivationServices.cs
- SafeNativeMemoryHandle.cs
- ExtensionDataReader.cs
- TerminatorSinks.cs
- BaseTemplateBuildProvider.cs
- ProxyWebPartManager.cs
- CaretElement.cs
- HostedTcpTransportManager.cs
- AdRotator.cs
- EntityClassGenerator.cs
- BrowserCapabilitiesFactory.cs
- ListSourceHelper.cs
- BehaviorEditorPart.cs
- SystemTcpStatistics.cs
- TemplateAction.cs
- Timer.cs
- ListBoxAutomationPeer.cs
- DataGridViewRowsAddedEventArgs.cs
- UnsafeNativeMethods.cs
- SqlEnums.cs
- ControlUtil.cs
- BitmapDecoder.cs
- SelectionPatternIdentifiers.cs