Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- ResourceManagerWrapper.cs
- LoggedException.cs
- PropertySet.cs
- AttributeQuery.cs
- CopyNamespacesAction.cs
- DSASignatureFormatter.cs
- QueryRewriter.cs
- SByte.cs
- Module.cs
- CachingHintValidation.cs
- Durable.cs
- DelayDesigner.cs
- ReceiveMessageAndVerifySecurityAsyncResultBase.cs
- IPHostEntry.cs
- CompilerErrorCollection.cs
- DodSequenceMerge.cs
- DataPagerField.cs
- DataServicePagingProviderWrapper.cs
- ConfigurationManagerInternalFactory.cs
- OrthographicCamera.cs
- WebPartTransformer.cs
- HealthMonitoringSection.cs
- TypeDependencyAttribute.cs
- IgnorePropertiesAttribute.cs
- ByteArrayHelperWithString.cs
- DiffuseMaterial.cs
- InitiatorServiceModelSecurityTokenRequirement.cs
- ChannelManagerBase.cs
- CodeTryCatchFinallyStatement.cs
- SecurityRuntime.cs
- EventWaitHandle.cs
- XmlQueryRuntime.cs
- RSAPKCS1SignatureDeformatter.cs
- ToolStripDropDown.cs
- TimeEnumHelper.cs
- RegexGroupCollection.cs
- HtmlHistory.cs
- FileCodeGroup.cs
- UnsignedPublishLicense.cs
- SchemaTypeEmitter.cs
- BasicExpandProvider.cs
- OleDbDataReader.cs
- ModuleBuilderData.cs
- WinEventTracker.cs
- MULTI_QI.cs
- ColumnMapProcessor.cs
- SrgsOneOf.cs
- PropertyOverridesTypeEditor.cs
- StylusPointPropertyInfoDefaults.cs
- BaseWebProxyFinder.cs
- arc.cs
- SortedList.cs
- DataTableClearEvent.cs
- BindingListCollectionView.cs
- Panel.cs
- ActiveXHelper.cs
- CursorConverter.cs
- TlsSspiNegotiation.cs
- XmlSecureResolver.cs
- ComponentChangedEvent.cs
- QilChoice.cs
- DataKeyArray.cs
- DSASignatureDeformatter.cs
- UTF32Encoding.cs
- MatrixAnimationBase.cs
- _Semaphore.cs
- Int32Collection.cs
- ShapeTypeface.cs
- QilList.cs
- UpWmlMobileTextWriter.cs
- HostedTcpTransportManager.cs
- AttributeUsageAttribute.cs
- SqlDataSourceFilteringEventArgs.cs
- RemoteWebConfigurationHost.cs
- SettingsAttributes.cs
- TypeDelegator.cs
- FixedFlowMap.cs
- ForeignConstraint.cs
- StyleReferenceConverter.cs
- D3DImage.cs
- EpmSyndicationContentDeSerializer.cs
- Selector.cs
- GradientStopCollection.cs
- _AuthenticationState.cs
- WindowInteropHelper.cs
- FormViewDeleteEventArgs.cs
- ContainerUtilities.cs
- TypeBinaryExpression.cs
- GroupBox.cs
- XmlNullResolver.cs
- Instrumentation.cs
- VerificationException.cs
- CatalogZone.cs
- RedistVersionInfo.cs
- ByteStream.cs
- System.Data_BID.cs
- DataStorage.cs
- BackgroundFormatInfo.cs
- CodeTypeMember.cs
- Dictionary.cs