Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / Common / DBDataPermissionAttribute.cs / 1305376 / 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 )] public 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] public 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 )] public 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] public 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
- SymLanguageVendor.cs
- ApplicationId.cs
- GridViewEditEventArgs.cs
- SmiEventSink_DeferedProcessing.cs
- Registry.cs
- PackagePartCollection.cs
- TextBoxDesigner.cs
- StretchValidation.cs
- OleAutBinder.cs
- HttpRuntime.cs
- RequestNavigateEventArgs.cs
- NamespaceInfo.cs
- Listbox.cs
- DoubleMinMaxAggregationOperator.cs
- dbenumerator.cs
- ReachBasicContext.cs
- EventLogPermissionEntryCollection.cs
- MethodBody.cs
- ZipFileInfoCollection.cs
- _LocalDataStore.cs
- PointAnimationClockResource.cs
- OdbcDataAdapter.cs
- CodeTypeOfExpression.cs
- WindowsSlider.cs
- SessionPageStatePersister.cs
- CodeLinePragma.cs
- ServiceModelConfiguration.cs
- DependencyObjectProvider.cs
- ModulesEntry.cs
- OracleInfoMessageEventArgs.cs
- HierarchicalDataTemplate.cs
- RightsManagementInformation.cs
- FusionWrap.cs
- Empty.cs
- RectKeyFrameCollection.cs
- WebSysDisplayNameAttribute.cs
- CatalogPartCollection.cs
- WebPartVerbCollection.cs
- HttpBufferlessInputStream.cs
- InvalidDocumentContentsException.cs
- TraceSource.cs
- EntitySqlQueryCacheEntry.cs
- TextFormatterContext.cs
- SizeIndependentAnimationStorage.cs
- _AcceptOverlappedAsyncResult.cs
- AppDomainAttributes.cs
- SR.cs
- FormsAuthenticationConfiguration.cs
- GetRecipientRequest.cs
- FormViewInsertEventArgs.cs
- ConfigUtil.cs
- Mutex.cs
- XmlSchemaComplexContent.cs
- PriorityQueue.cs
- CodeNamespace.cs
- XmlMemberMapping.cs
- CapabilitiesAssignment.cs
- TransformCollection.cs
- CodeParameterDeclarationExpressionCollection.cs
- XmlSchemaInfo.cs
- HandledMouseEvent.cs
- newitemfactory.cs
- ManipulationStartingEventArgs.cs
- ExpandSegmentCollection.cs
- ISessionStateStore.cs
- ToolStripDropDownClosedEventArgs.cs
- SystemFonts.cs
- Message.cs
- ColorConvertedBitmap.cs
- SQLByteStorage.cs
- TransformerConfigurationWizardBase.cs
- HelpProvider.cs
- XPathDocument.cs
- SerializationStore.cs
- ServerProtocol.cs
- ProtocolsConfigurationHandler.cs
- DataGridViewRowPrePaintEventArgs.cs
- CssStyleCollection.cs
- ExpressionBindingCollection.cs
- Version.cs
- ThemeableAttribute.cs
- DiagnosticTrace.cs
- EntityDataSourceSelectingEventArgs.cs
- ObjectFullSpanRewriter.cs
- ToolStripSettings.cs
- CategoryAttribute.cs
- LineBreakRecord.cs
- DispatcherExceptionEventArgs.cs
- NetworkInformationPermission.cs
- Queue.cs
- ImageFormat.cs
- View.cs
- WebRequestModuleElementCollection.cs
- DataSourceProvider.cs
- ArgumentNullException.cs
- AssemblyAssociatedContentFileAttribute.cs
- ProvidersHelper.cs
- IndentedWriter.cs
- SqlEnums.cs
- DataReceivedEventArgs.cs