Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ContentFileHelper.cs
- Encoder.cs
- XmlSchemaComplexContentRestriction.cs
- TextTreeInsertElementUndoUnit.cs
- CacheOutputQuery.cs
- CompositeCollectionView.cs
- AmbientProperties.cs
- DataControlImageButton.cs
- SchemaNames.cs
- XmlDataSourceView.cs
- ArrayHelper.cs
- GenericEnumConverter.cs
- basevalidator.cs
- InstanceCreationEditor.cs
- ProcessModule.cs
- SuppressIldasmAttribute.cs
- StringCollection.cs
- Merger.cs
- MatcherBuilder.cs
- RadioButton.cs
- PenLineJoinValidation.cs
- PropertyChangingEventArgs.cs
- RightsManagementEncryptionTransform.cs
- RemotingConfiguration.cs
- KeyedByTypeCollection.cs
- NameValueSectionHandler.cs
- _ProxyRegBlob.cs
- Opcode.cs
- PowerStatus.cs
- DynamicMetaObject.cs
- HMACSHA1.cs
- ToolStripPanelRow.cs
- WebPartDescriptionCollection.cs
- Merger.cs
- EndpointNameMessageFilter.cs
- PolicyChain.cs
- FrameworkElement.cs
- EntitySqlQueryBuilder.cs
- ToolStripDropTargetManager.cs
- DocumentViewerHelper.cs
- SystemEvents.cs
- BasicHttpBindingElement.cs
- COM2TypeInfoProcessor.cs
- SetStoryboardSpeedRatio.cs
- BindingCompleteEventArgs.cs
- FixedTextBuilder.cs
- PropertyPath.cs
- PropertyGridView.cs
- CanonicalFontFamilyReference.cs
- TableLayoutRowStyleCollection.cs
- BamlMapTable.cs
- ProcessHost.cs
- TextRunCache.cs
- Label.cs
- SafeRightsManagementPubHandle.cs
- Point3DCollection.cs
- EntryPointNotFoundException.cs
- RectangleHotSpot.cs
- SimpleTextLine.cs
- ViewEventArgs.cs
- ResolveNameEventArgs.cs
- ActivatedMessageQueue.cs
- SmiMetaDataProperty.cs
- XmlDocumentFragment.cs
- NullToBooleanConverter.cs
- ReachSerializer.cs
- NullableIntAverageAggregationOperator.cs
- TraceLevelStore.cs
- GroupItem.cs
- XpsInterleavingPolicy.cs
- _NTAuthentication.cs
- SiteMapDataSourceView.cs
- SchemaAttDef.cs
- XmlIncludeAttribute.cs
- OverflowException.cs
- AnnotationObservableCollection.cs
- SingleObjectCollection.cs
- TextEffect.cs
- _BufferOffsetSize.cs
- FontWeights.cs
- KnownTypeDataContractResolver.cs
- MenuItemBindingCollection.cs
- SafeCryptHandles.cs
- StreamReader.cs
- Codec.cs
- Maps.cs
- DocumentViewerBaseAutomationPeer.cs
- KerberosRequestorSecurityToken.cs
- ReflectionPermission.cs
- ColumnHeaderConverter.cs
- FileDetails.cs
- ProbeDuplexCD1AsyncResult.cs
- GlobalizationSection.cs
- EncodingTable.cs
- RegexCompilationInfo.cs
- X509CertificateClaimSet.cs
- ReflectionPermission.cs
- Matrix.cs
- GridViewCommandEventArgs.cs
- ScrollItemPatternIdentifiers.cs