Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Data / System / Data / Common / DBDataPermissionAttribute.cs / 1 / DBDataPermissionAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- #if ORACLE namespace System.Data.OracleClient { #else namespace System.Data.Common { #endif using System.ComponentModel; using System.Data.Common; using System.Diagnostics; using System.Security; using System.Security.Permissions; /* derived class pattern [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )] [Serializable] sealed public class XPermissionAttribute : DBDataPermissionAttribute { public XPermissionAttribute(SecurityAction action) : base(action) { } override public IPermission CreatePermission() { return new XPermission(this); } } */ #if ORACLE sealed public partial class OraclePermissionAttribute : CodeAccessSecurityAttribute { #else [Serializable(), AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )] #if WINFSInternalOnly internal #else public #endif abstract class DBDataPermissionAttribute : CodeAccessSecurityAttribute { // V1.0.3300 #endif private bool _allowBlankPassword;// = false; private string _connectionString;// = ADP.StrEmpty; private string _restrictions;// = ADP.StrEmpty; private KeyRestrictionBehavior _behavior;// = KeyRestrictionBehavior.AllowOnly; #if !ORACLE protected DBDataPermissionAttribute(SecurityAction action) : base(action) { } #endif public bool AllowBlankPassword { // V1.0.3300 get { return _allowBlankPassword; } set { _allowBlankPassword = value; } } public string ConnectionString { // V1.0.5000 get { string value = _connectionString; return ((null != value) ? value : String.Empty); } set { _connectionString = value; } } public KeyRestrictionBehavior KeyRestrictionBehavior { // V1.0.5000, default AllowOnly get { return _behavior; } set { switch(value) { case KeyRestrictionBehavior.PreventUsage: case KeyRestrictionBehavior.AllowOnly: _behavior = value; break; default: throw ADP.InvalidKeyRestrictionBehavior(value); } } } public string KeyRestrictions { // V1.0.5000 get { string value = _restrictions; return (null != value) ? value : ADP.StrEmpty; } set { _restrictions = value; } } [ EditorBrowsableAttribute(EditorBrowsableState.Never) ] public bool ShouldSerializeConnectionString() { // V1.2.3300 return (null != _connectionString); } [ EditorBrowsableAttribute(EditorBrowsableState.Never) ] public bool ShouldSerializeKeyRestrictions() { // V1.2.3300 return (null != _restrictions); } } } #if !ORACLE namespace System.Data { // MDAC 83087 [Serializable] #if WINFSInternalOnly internal #else public #endif enum KeyRestrictionBehavior { // V1.0.5000 AllowOnly = 0, PreventUsage = 1, } } #endif // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- #if ORACLE namespace System.Data.OracleClient { #else namespace System.Data.Common { #endif using System.ComponentModel; using System.Data.Common; using System.Diagnostics; using System.Security; using System.Security.Permissions; /* derived class pattern [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )] [Serializable] sealed public class XPermissionAttribute : DBDataPermissionAttribute { public XPermissionAttribute(SecurityAction action) : base(action) { } override public IPermission CreatePermission() { return new XPermission(this); } } */ #if ORACLE sealed public partial class OraclePermissionAttribute : CodeAccessSecurityAttribute { #else [Serializable(), AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )] #if WINFSInternalOnly internal #else public #endif abstract class DBDataPermissionAttribute : CodeAccessSecurityAttribute { // V1.0.3300 #endif private bool _allowBlankPassword;// = false; private string _connectionString;// = ADP.StrEmpty; private string _restrictions;// = ADP.StrEmpty; private KeyRestrictionBehavior _behavior;// = KeyRestrictionBehavior.AllowOnly; #if !ORACLE protected DBDataPermissionAttribute(SecurityAction action) : base(action) { } #endif public bool AllowBlankPassword { // V1.0.3300 get { return _allowBlankPassword; } set { _allowBlankPassword = value; } } public string ConnectionString { // V1.0.5000 get { string value = _connectionString; return ((null != value) ? value : String.Empty); } set { _connectionString = value; } } public KeyRestrictionBehavior KeyRestrictionBehavior { // V1.0.5000, default AllowOnly get { return _behavior; } set { switch(value) { case KeyRestrictionBehavior.PreventUsage: case KeyRestrictionBehavior.AllowOnly: _behavior = value; break; default: throw ADP.InvalidKeyRestrictionBehavior(value); } } } public string KeyRestrictions { // V1.0.5000 get { string value = _restrictions; return (null != value) ? value : ADP.StrEmpty; } set { _restrictions = value; } } [ EditorBrowsableAttribute(EditorBrowsableState.Never) ] public bool ShouldSerializeConnectionString() { // V1.2.3300 return (null != _connectionString); } [ EditorBrowsableAttribute(EditorBrowsableState.Never) ] public bool ShouldSerializeKeyRestrictions() { // V1.2.3300 return (null != _restrictions); } } } #if !ORACLE namespace System.Data { // MDAC 83087 [Serializable] #if WINFSInternalOnly internal #else public #endif enum KeyRestrictionBehavior { // V1.0.5000 AllowOnly = 0, PreventUsage = 1, } } #endif // 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
- DataGridCommandEventArgs.cs
- InkCanvasFeedbackAdorner.cs
- RankException.cs
- ErrorStyle.cs
- baseaxisquery.cs
- HyperLink.cs
- Border.cs
- StateWorkerRequest.cs
- FamilyMapCollection.cs
- HostingEnvironment.cs
- XamlPointCollectionSerializer.cs
- BitmapInitialize.cs
- SendingRequestEventArgs.cs
- DrawItemEvent.cs
- WebPartDisplayMode.cs
- Model3DGroup.cs
- CheckBoxDesigner.cs
- PrivilegeNotHeldException.cs
- ItemList.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- Section.cs
- SqlFileStream.cs
- listitem.cs
- SuppressIldasmAttribute.cs
- ScriptResourceInfo.cs
- CLSCompliantAttribute.cs
- BamlStream.cs
- Adorner.cs
- GenericUriParser.cs
- HtmlElement.cs
- OleDbParameter.cs
- PersonalizationProviderCollection.cs
- SqlStatistics.cs
- BindingManagerDataErrorEventArgs.cs
- TreeViewImageKeyConverter.cs
- QilParameter.cs
- SamlConstants.cs
- IdentityModelStringsVersion1.cs
- SqlTrackingQuery.cs
- AppModelKnownContentFactory.cs
- TextBoxView.cs
- IdleTimeoutMonitor.cs
- AffineTransform3D.cs
- Int32Animation.cs
- CommonXSendMessage.cs
- Baml2006ReaderContext.cs
- SpAudioStreamWrapper.cs
- CopyNamespacesAction.cs
- ArraySortHelper.cs
- TableStyle.cs
- WebBrowsableAttribute.cs
- DesignerActionVerbList.cs
- GraphicsPathIterator.cs
- EncryptedPackage.cs
- unsafeIndexingFilterStream.cs
- VectorCollection.cs
- FormsAuthenticationEventArgs.cs
- WebPartConnectionsConnectVerb.cs
- CodeIdentifier.cs
- EventLogPermissionAttribute.cs
- StylusPlugInCollection.cs
- ImageCodecInfo.cs
- X509ServiceCertificateAuthentication.cs
- IntegerFacetDescriptionElement.cs
- ObjectResult.cs
- TabControlCancelEvent.cs
- TextEffectCollection.cs
- ValidationHelper.cs
- PseudoWebRequest.cs
- WithParamAction.cs
- BitmapSource.cs
- GridLength.cs
- HtmlInputFile.cs
- QilChoice.cs
- NativeMethods.cs
- ProcessHost.cs
- TranslateTransform3D.cs
- DateTimeConverter.cs
- CollectionConverter.cs
- CodeCatchClauseCollection.cs
- XmlSchemaCompilationSettings.cs
- XmlSerializableServices.cs
- ToolBarButtonClickEvent.cs
- TableRow.cs
- XmlSchemaException.cs
- WebReferenceOptions.cs
- StreamMarshaler.cs
- BamlVersionHeader.cs
- ImageCodecInfoPrivate.cs
- OutputCacheEntry.cs
- SoapExtension.cs
- DataSource.cs
- SelectedGridItemChangedEvent.cs
- ConstructorBuilder.cs
- tibetanshape.cs
- LocatorPartList.cs
- PageAsyncTask.cs
- XPathNodeInfoAtom.cs
- PriorityChain.cs
- TypeHelpers.cs