Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / security / system / security / permissions / typedescriptorpermissionattribute.cs / 1305376 / typedescriptorpermissionattribute.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // TypeDescriptorPermissionAttribute.cs // namespace System.Security.Permissions { [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )] [Serializable()] public sealed class TypeDescriptorPermissionAttribute : CodeAccessSecurityAttribute { TypeDescriptorPermissionFlags m_flags = TypeDescriptorPermissionFlags.NoFlags; public TypeDescriptorPermissionAttribute(SecurityAction action) : base(action) {} public TypeDescriptorPermissionFlags Flags { get { return m_flags; } set { TypeDescriptorPermission.VerifyFlags(value); m_flags = value; } } public bool RestrictedRegistrationAccess { get { return (m_flags & TypeDescriptorPermissionFlags.RestrictedRegistrationAccess) != 0; } set { m_flags = value ? m_flags | TypeDescriptorPermissionFlags.RestrictedRegistrationAccess : m_flags & ~TypeDescriptorPermissionFlags.RestrictedRegistrationAccess; } } public override IPermission CreatePermission() { if (Unrestricted) return new TypeDescriptorPermission(PermissionState.Unrestricted); else return new TypeDescriptorPermission(m_flags); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // TypeDescriptorPermissionAttribute.cs // namespace System.Security.Permissions { [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )] [Serializable()] public sealed class TypeDescriptorPermissionAttribute : CodeAccessSecurityAttribute { TypeDescriptorPermissionFlags m_flags = TypeDescriptorPermissionFlags.NoFlags; public TypeDescriptorPermissionAttribute(SecurityAction action) : base(action) {} public TypeDescriptorPermissionFlags Flags { get { return m_flags; } set { TypeDescriptorPermission.VerifyFlags(value); m_flags = value; } } public bool RestrictedRegistrationAccess { get { return (m_flags & TypeDescriptorPermissionFlags.RestrictedRegistrationAccess) != 0; } set { m_flags = value ? m_flags | TypeDescriptorPermissionFlags.RestrictedRegistrationAccess : m_flags & ~TypeDescriptorPermissionFlags.RestrictedRegistrationAccess; } } public override IPermission CreatePermission() { if (Unrestricted) return new TypeDescriptorPermission(PermissionState.Unrestricted); else return new TypeDescriptorPermission(m_flags); } } } // 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
- DebugView.cs
- KnownIds.cs
- Storyboard.cs
- Action.cs
- Literal.cs
- DNS.cs
- Compiler.cs
- RelationshipDetailsRow.cs
- IdentifierCollection.cs
- HelpPage.cs
- XmlEncodedRawTextWriter.cs
- ServiceObjectContainer.cs
- RuntimeCompatibilityAttribute.cs
- FixedSOMImage.cs
- TextServicesProperty.cs
- CommonDialog.cs
- HotSpot.cs
- RadioButtonList.cs
- DPTypeDescriptorContext.cs
- Debug.cs
- StatementContext.cs
- cache.cs
- SchemaNotation.cs
- DataGridRow.cs
- XmlDataSourceDesigner.cs
- PatternMatcher.cs
- ProtocolsSection.cs
- AcceleratedTokenProvider.cs
- ObjectKeyFrameCollection.cs
- SecurityElement.cs
- SqlDelegatedTransaction.cs
- CompModSwitches.cs
- X509CertificateRecipientServiceCredential.cs
- basecomparevalidator.cs
- AesManaged.cs
- WebPartVerb.cs
- ComplexPropertyEntry.cs
- ExeContext.cs
- EdmSchemaAttribute.cs
- PropertiesTab.cs
- DataSourceCacheDurationConverter.cs
- ValidatorCompatibilityHelper.cs
- EdmComplexTypeAttribute.cs
- EventManager.cs
- XmlNodeChangedEventArgs.cs
- NavigationPropertyAccessor.cs
- TileBrush.cs
- CodeTypeParameter.cs
- BufferedGraphics.cs
- DataObject.cs
- CommandEventArgs.cs
- IndexerNameAttribute.cs
- ClientSideQueueItem.cs
- XmlCustomFormatter.cs
- SafeMILHandleMemoryPressure.cs
- StandardToolWindows.cs
- ObjRef.cs
- TextTreePropertyUndoUnit.cs
- ExpandableObjectConverter.cs
- ProxyGenerationError.cs
- TemplateControlCodeDomTreeGenerator.cs
- CallbackValidatorAttribute.cs
- PersonalizationStateInfo.cs
- StorageEndPropertyMapping.cs
- HtmlInputReset.cs
- MouseWheelEventArgs.cs
- IItemContainerGenerator.cs
- InternalRelationshipCollection.cs
- BypassElement.cs
- BamlMapTable.cs
- WebBrowserEvent.cs
- DataGridComponentEditor.cs
- Transform3D.cs
- ComponentConverter.cs
- StateManagedCollection.cs
- MenuCommand.cs
- DataAdapter.cs
- XmlSerializationWriter.cs
- CodeTypeConstructor.cs
- ClosureBinding.cs
- RegistrySecurity.cs
- CryptoProvider.cs
- RowBinding.cs
- ContextBase.cs
- _ListenerAsyncResult.cs
- DelayedRegex.cs
- XmlWellformedWriter.cs
- MonitoringDescriptionAttribute.cs
- rsa.cs
- WinFormsUtils.cs
- BooleanFunctions.cs
- DefaultSerializationProviderAttribute.cs
- translator.cs
- AlternationConverter.cs
- HttpConfigurationContext.cs
- NotifyParentPropertyAttribute.cs
- HtmlTableRow.cs
- Queue.cs
- DBBindings.cs
- FormsAuthenticationUserCollection.cs