Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- LineBreakRecord.cs
- safesecurityhelperavalon.cs
- DataGridPageChangedEventArgs.cs
- TextBlock.cs
- PerformanceCounterLib.cs
- ColumnReorderedEventArgs.cs
- XNameTypeConverter.cs
- CompilationRelaxations.cs
- ListViewInsertedEventArgs.cs
- WhitespaceRuleReader.cs
- WindowInteropHelper.cs
- Geometry3D.cs
- XmlHierarchyData.cs
- AmbiguousMatchException.cs
- PointLight.cs
- ItemAutomationPeer.cs
- EventHandlersStore.cs
- xsdvalidator.cs
- SkewTransform.cs
- Int32EqualityComparer.cs
- MonthChangedEventArgs.cs
- OleDbPermission.cs
- ScrollEventArgs.cs
- RepeaterItem.cs
- TargetControlTypeAttribute.cs
- InternalBufferManager.cs
- SqlAggregateChecker.cs
- ContainerParagraph.cs
- TableLayoutSettings.cs
- IssuedTokenServiceCredential.cs
- AddInPipelineAttributes.cs
- EventData.cs
- Collection.cs
- UTF8Encoding.cs
- SystemIPGlobalStatistics.cs
- Lock.cs
- KeyManager.cs
- SaveWorkflowCommand.cs
- RuleSetBrowserDialog.cs
- TableRow.cs
- SortableBindingList.cs
- ResourceReferenceKeyNotFoundException.cs
- XmlReader.cs
- TextUtf8RawTextWriter.cs
- AutomationElement.cs
- SystemNetHelpers.cs
- XPathSingletonIterator.cs
- OleStrCAMarshaler.cs
- CommonObjectSecurity.cs
- ProviderBase.cs
- TextParagraphView.cs
- WebPartManagerDesigner.cs
- ToolboxComponentsCreatedEventArgs.cs
- DecoderBestFitFallback.cs
- altserialization.cs
- FileUtil.cs
- TrustManager.cs
- shaperfactoryquerycacheentry.cs
- MetadataItem_Static.cs
- ChangeBlockUndoRecord.cs
- SystemInformation.cs
- TickBar.cs
- UserControl.cs
- ZoomPercentageConverter.cs
- TemplatedAdorner.cs
- XmlDataLoader.cs
- RawStylusActions.cs
- ReflectEventDescriptor.cs
- VScrollProperties.cs
- ScrollableControl.cs
- ValidationRuleCollection.cs
- DecimalSumAggregationOperator.cs
- BookmarkNameHelper.cs
- RequestCacheManager.cs
- SafeLocalMemHandle.cs
- DataGridColumnReorderingEventArgs.cs
- GlyphRunDrawing.cs
- ProfilePropertyMetadata.cs
- TextDpi.cs
- StringSorter.cs
- MatrixCamera.cs
- MenuScrollingVisibilityConverter.cs
- ListBindingHelper.cs
- NamespaceList.cs
- SmtpTransport.cs
- MultipleViewProviderWrapper.cs
- SmtpNtlmAuthenticationModule.cs
- ProcessModule.cs
- ThrowHelper.cs
- CallSiteBinder.cs
- WebEvents.cs
- CollectionBase.cs
- Condition.cs
- XmlSchemaSimpleTypeList.cs
- ResourceBinder.cs
- SafeFindHandle.cs
- MiniParameterInfo.cs
- SR.cs
- MD5.cs
- IISUnsafeMethods.cs