Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MetadataProperty.cs
- SHA512.cs
- XmlAttributeOverrides.cs
- UniqueConstraint.cs
- DataGridViewCellCancelEventArgs.cs
- ReadOnlyAttribute.cs
- DriveNotFoundException.cs
- Underline.cs
- _SpnDictionary.cs
- SqlDelegatedTransaction.cs
- HttpModuleCollection.cs
- StylusEditingBehavior.cs
- ComponentEvent.cs
- TextPattern.cs
- GatewayIPAddressInformationCollection.cs
- TargetConverter.cs
- ItemChangedEventArgs.cs
- StaticTextPointer.cs
- RSAPKCS1SignatureDeformatter.cs
- DbParameterHelper.cs
- WebServiceResponseDesigner.cs
- IdnElement.cs
- UdpDuplexChannel.cs
- CharStorage.cs
- WebScriptMetadataFormatter.cs
- XmlSchemaExporter.cs
- ButtonFlatAdapter.cs
- TypeGeneratedEventArgs.cs
- PropertyGridView.cs
- ConnectionPoolManager.cs
- SecurityRequiresReviewAttribute.cs
- XmlHelper.cs
- DrawTreeNodeEventArgs.cs
- ISessionStateStore.cs
- SafeViewOfFileHandle.cs
- TrackingExtract.cs
- Misc.cs
- FixedSOMImage.cs
- ConfigurationSettings.cs
- ScrollableControl.cs
- Logging.cs
- BoundField.cs
- MimeObjectFactory.cs
- XmlCharCheckingReader.cs
- WebBrowserBase.cs
- QilUnary.cs
- DataGridAutomationPeer.cs
- AssemblyBuilderData.cs
- UpDownEvent.cs
- ListenerElementsCollection.cs
- CompositeDuplexBindingElement.cs
- RepeaterItem.cs
- OptionalMessageQuery.cs
- BufferedMessageData.cs
- HelpEvent.cs
- DebuggerAttributes.cs
- webbrowsersite.cs
- ModelItemDictionary.cs
- WindowsScrollBar.cs
- HttpFileCollectionWrapper.cs
- XsltConvert.cs
- SequenceDesigner.cs
- PenLineJoinValidation.cs
- _SSPIWrapper.cs
- MulticastNotSupportedException.cs
- Bold.cs
- OracleConnectionFactory.cs
- DetailsViewRowCollection.cs
- DbDataAdapter.cs
- SafeBuffer.cs
- SequentialUshortCollection.cs
- PDBReader.cs
- Tokenizer.cs
- ToolBarDesigner.cs
- RightsManagementEncryptionTransform.cs
- ConfigurationException.cs
- DataGridViewRowsAddedEventArgs.cs
- DataTableReader.cs
- ToolStripDropDown.cs
- DataServiceHost.cs
- HostingEnvironmentSection.cs
- Transform.cs
- NullToBooleanConverter.cs
- MultiByteCodec.cs
- UpdateException.cs
- Transactions.cs
- WmlPanelAdapter.cs
- SqlConnectionStringBuilder.cs
- TemplateXamlTreeBuilder.cs
- WorkflowApplicationAbortedEventArgs.cs
- ObjectDataSourceSelectingEventArgs.cs
- DelegatedStream.cs
- HttpVersion.cs
- JsonDeserializer.cs
- DataSourceSelectArguments.cs
- FontSourceCollection.cs
- ScrollableControlDesigner.cs
- RuntimeEnvironment.cs
- PackagingUtilities.cs
- SoapIncludeAttribute.cs