Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Data / System / Data / OleDb / OleDbPermission.cs / 1 / OleDbPermission.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.OleDb { using System.Collections; using System.Collections.Generic; using System.Data.Common; using System.Globalization; using System.Runtime.Serialization; using System.Security; using System.Security.Permissions; [Serializable] #if WINFSInternalOnly internal #else public #endif sealed class OleDbPermission : DBDataPermission { private String[] _providerRestriction; // should never be string[0] private String _providers; [ Obsolete("OleDbPermission() has been deprecated. Use the OleDbPermission(PermissionState.None) constructor. http://go.microsoft.com/fwlink/?linkid=14202", true) ] // MDAC 86034 public OleDbPermission() : this(PermissionState.None) { } public OleDbPermission(PermissionState state) : base(state) { } [ Obsolete("OleDbPermission(PermissionState state, Boolean allowBlankPassword) has been deprecated. Use the OleDbPermission(PermissionState.None) constructor. http://go.microsoft.com/fwlink/?linkid=14202", true) ] // MDAC 86034 public OleDbPermission(PermissionState state, bool allowBlankPassword) : this(state) { AllowBlankPassword = allowBlankPassword; } private OleDbPermission(OleDbPermission permission) : base(permission) { // for Copy } internal OleDbPermission(OleDbPermissionAttribute permissionAttribute) : base(permissionAttribute) { // for CreatePermission } internal OleDbPermission(OleDbConnectionString constr) : base(constr) { // for Open if ((null == constr) || constr.IsEmpty) { base.Add(ADP.StrEmpty, ADP.StrEmpty, KeyRestrictionBehavior.AllowOnly); } } [System.ComponentModel.Browsable(false)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [Obsolete("Provider property has been deprecated. Use the Add method. http://go.microsoft.com/fwlink/?linkid=14202")] public string Provider { get { string providers = _providers; // MDAC 83103 if (null == providers) { string[] restrictions = _providerRestriction; if (null != restrictions) { if (0 < restrictions.Length) { providers = restrictions[0]; for (int i = 1; i < restrictions.Length; ++i) { providers += ";" + restrictions[i]; } } } } return ((null != providers) ? providers : ADP.StrEmpty); } set { // MDAC 61263 string[] restrictions = null; if (!ADP.IsEmpty(value)) { restrictions = value.Split(new char[1] { ';' }); restrictions = DBConnectionString.RemoveDuplicates(restrictions); } _providerRestriction = restrictions; _providers = value; } } override public IPermission Copy () { return new OleDbPermission(this); } } [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )] [Serializable] #if WINFSInternalOnly internal #else public #endif sealed class OleDbPermissionAttribute : DBDataPermissionAttribute { private String _providers; public OleDbPermissionAttribute(SecurityAction action) : base(action) { } [System.ComponentModel.Browsable(false)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [Obsolete("Provider property has been deprecated. Use the Add method. http://go.microsoft.com/fwlink/?linkid=14202")] public String Provider { get { string providers = _providers; return ((null != providers) ? providers : ADP.StrEmpty); } set { _providers = value; } } override public IPermission CreatePermission() { return new OleDbPermission(this); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.OleDb { using System.Collections; using System.Collections.Generic; using System.Data.Common; using System.Globalization; using System.Runtime.Serialization; using System.Security; using System.Security.Permissions; [Serializable] #if WINFSInternalOnly internal #else public #endif sealed class OleDbPermission : DBDataPermission { private String[] _providerRestriction; // should never be string[0] private String _providers; [ Obsolete("OleDbPermission() has been deprecated. Use the OleDbPermission(PermissionState.None) constructor. http://go.microsoft.com/fwlink/?linkid=14202", true) ] // MDAC 86034 public OleDbPermission() : this(PermissionState.None) { } public OleDbPermission(PermissionState state) : base(state) { } [ Obsolete("OleDbPermission(PermissionState state, Boolean allowBlankPassword) has been deprecated. Use the OleDbPermission(PermissionState.None) constructor. http://go.microsoft.com/fwlink/?linkid=14202", true) ] // MDAC 86034 public OleDbPermission(PermissionState state, bool allowBlankPassword) : this(state) { AllowBlankPassword = allowBlankPassword; } private OleDbPermission(OleDbPermission permission) : base(permission) { // for Copy } internal OleDbPermission(OleDbPermissionAttribute permissionAttribute) : base(permissionAttribute) { // for CreatePermission } internal OleDbPermission(OleDbConnectionString constr) : base(constr) { // for Open if ((null == constr) || constr.IsEmpty) { base.Add(ADP.StrEmpty, ADP.StrEmpty, KeyRestrictionBehavior.AllowOnly); } } [System.ComponentModel.Browsable(false)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [Obsolete("Provider property has been deprecated. Use the Add method. http://go.microsoft.com/fwlink/?linkid=14202")] public string Provider { get { string providers = _providers; // MDAC 83103 if (null == providers) { string[] restrictions = _providerRestriction; if (null != restrictions) { if (0 < restrictions.Length) { providers = restrictions[0]; for (int i = 1; i < restrictions.Length; ++i) { providers += ";" + restrictions[i]; } } } } return ((null != providers) ? providers : ADP.StrEmpty); } set { // MDAC 61263 string[] restrictions = null; if (!ADP.IsEmpty(value)) { restrictions = value.Split(new char[1] { ';' }); restrictions = DBConnectionString.RemoveDuplicates(restrictions); } _providerRestriction = restrictions; _providers = value; } } override public IPermission Copy () { return new OleDbPermission(this); } } [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )] [Serializable] #if WINFSInternalOnly internal #else public #endif sealed class OleDbPermissionAttribute : DBDataPermissionAttribute { private String _providers; public OleDbPermissionAttribute(SecurityAction action) : base(action) { } [System.ComponentModel.Browsable(false)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [Obsolete("Provider property has been deprecated. Use the Add method. http://go.microsoft.com/fwlink/?linkid=14202")] public String Provider { get { string providers = _providers; return ((null != providers) ? providers : ADP.StrEmpty); } set { _providers = value; } } override public IPermission CreatePermission() { return new OleDbPermission(this); } } } // 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
- HttpModulesSection.cs
- SqlParameterizer.cs
- PathStreamGeometryContext.cs
- TextDecorations.cs
- SkewTransform.cs
- Command.cs
- DynamicVirtualDiscoSearcher.cs
- HttpRequest.cs
- ImageCreator.cs
- ProtocolsConfiguration.cs
- WindowsFormsDesignerOptionService.cs
- WebHttpBinding.cs
- ImageUrlEditor.cs
- WorkflowMarkupSerializationException.cs
- UnionCodeGroup.cs
- StylusButton.cs
- CapabilitiesUse.cs
- PartitionerStatic.cs
- Accessible.cs
- ClosureBinding.cs
- FileAuthorizationModule.cs
- ModelItemDictionaryImpl.cs
- ByteBufferPool.cs
- MruCache.cs
- VisualStyleRenderer.cs
- MappingException.cs
- ByteStack.cs
- ExpressionBindings.cs
- PerspectiveCamera.cs
- HelpEvent.cs
- DataGridItem.cs
- ISO2022Encoding.cs
- DistributedTransactionPermission.cs
- CodeArgumentReferenceExpression.cs
- DbDataSourceEnumerator.cs
- _ConnectStream.cs
- WebBrowser.cs
- StaticSiteMapProvider.cs
- DivideByZeroException.cs
- TrustLevel.cs
- TreeNodeCollection.cs
- Rect3DValueSerializer.cs
- OleDbCommand.cs
- SelectorAutomationPeer.cs
- BindValidator.cs
- DelegatingTypeDescriptionProvider.cs
- XmlValidatingReader.cs
- ConfigurationConverterBase.cs
- MatrixTransform3D.cs
- CheckBox.cs
- InstalledFontCollection.cs
- ProfileProvider.cs
- DataRowExtensions.cs
- EntityTypeEmitter.cs
- ToolstripProfessionalRenderer.cs
- CompensatableSequenceActivity.cs
- KeyedHashAlgorithm.cs
- Debug.cs
- WorkflowRuntimeSection.cs
- DataGridViewIntLinkedList.cs
- SimpleWebHandlerParser.cs
- ActivityWithResultValueSerializer.cs
- CompositeTypefaceMetrics.cs
- CallTemplateAction.cs
- SqlConnectionPoolProviderInfo.cs
- RemotingConfiguration.cs
- RawTextInputReport.cs
- InternalRelationshipCollection.cs
- IImplicitResourceProvider.cs
- DataServiceRequestException.cs
- ObjectSet.cs
- WebPartTransformer.cs
- FrameworkPropertyMetadata.cs
- IPEndPoint.cs
- SettingsPropertyValueCollection.cs
- ConfigurationSectionGroup.cs
- XmlNullResolver.cs
- Soap.cs
- AnimationClockResource.cs
- Stopwatch.cs
- WpfKnownType.cs
- CompositeCollection.cs
- webproxy.cs
- DriveNotFoundException.cs
- XamlBrushSerializer.cs
- ListDataBindEventArgs.cs
- InstanceDataCollection.cs
- SqlDataSourceDesigner.cs
- DataKeyPropertyAttribute.cs
- TextBounds.cs
- TraceRecord.cs
- Track.cs
- ProfilePropertySettings.cs
- _FtpControlStream.cs
- ImageMapEventArgs.cs
- OperatorExpressions.cs
- PrtTicket_Public_Simple.cs
- SocketException.cs
- WebBrowserBase.cs
- CharAnimationUsingKeyFrames.cs