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
- TiffBitmapDecoder.cs
- DataGridBoolColumn.cs
- ImageListUtils.cs
- QilSortKey.cs
- FragmentNavigationEventArgs.cs
- TableLayoutStyle.cs
- ControlHelper.cs
- DocumentGridPage.cs
- StringExpressionSet.cs
- DuplexChannelFactory.cs
- InheritanceContextHelper.cs
- WebBaseEventKeyComparer.cs
- __FastResourceComparer.cs
- DataGridViewCellConverter.cs
- DeclarativeCatalogPart.cs
- ByeOperationAsyncResult.cs
- SystemNetHelpers.cs
- BitmapMetadataBlob.cs
- XamlBrushSerializer.cs
- SqlLiftWhereClauses.cs
- CompileXomlTask.cs
- DiscoveryClientReferences.cs
- WebConfigurationHost.cs
- COM2ICategorizePropertiesHandler.cs
- StackBuilderSink.cs
- EntityCommandCompilationException.cs
- ParserOptions.cs
- JsonReader.cs
- ContractMapping.cs
- HtmlTernaryTree.cs
- MenuAutomationPeer.cs
- Math.cs
- FieldToken.cs
- TopClause.cs
- NullableIntSumAggregationOperator.cs
- MetadataCollection.cs
- NonSerializedAttribute.cs
- WebPartManagerInternals.cs
- RightsManagementEncryptionTransform.cs
- CreateParams.cs
- DictionaryBase.cs
- DataGridViewToolTip.cs
- ValueTypeFixupInfo.cs
- XhtmlBasicPanelAdapter.cs
- SafeMILHandle.cs
- ChtmlTextWriter.cs
- EntityStoreSchemaGenerator.cs
- CodeDirectionExpression.cs
- X509CertificateCollection.cs
- EventMetadata.cs
- TimelineGroup.cs
- Span.cs
- FloatUtil.cs
- TextAdaptor.cs
- ResXDataNode.cs
- MarkedHighlightComponent.cs
- WebResourceUtil.cs
- PlainXmlDeserializer.cs
- ErrorHandler.cs
- RoleManagerModule.cs
- XmlValidatingReaderImpl.cs
- DbConnectionPoolCounters.cs
- HttpClientCredentialType.cs
- SqlErrorCollection.cs
- WmlControlAdapter.cs
- Base64Encoding.cs
- StructuredCompositeActivityDesigner.cs
- MetadataProperty.cs
- ContainsRowNumberChecker.cs
- DefaultSection.cs
- TableCellCollection.cs
- HitTestFilterBehavior.cs
- XmlAttributeOverrides.cs
- RbTree.cs
- InvalidComObjectException.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- TextReader.cs
- XmlBindingWorker.cs
- PathGradientBrush.cs
- ContainerFilterService.cs
- FormViewDeletedEventArgs.cs
- EntityDataSourceWrapper.cs
- RadioButtonFlatAdapter.cs
- SwitchElementsCollection.cs
- SpecialFolderEnumConverter.cs
- MaskInputRejectedEventArgs.cs
- ForceCopyBuildProvider.cs
- DocumentReference.cs
- SmtpNetworkElement.cs
- RegexWriter.cs
- ProfileManager.cs
- BitmapEffectrendercontext.cs
- AuthenticatedStream.cs
- IndexedGlyphRun.cs
- UpDownBaseDesigner.cs
- InkPresenter.cs
- ConstraintConverter.cs
- ImmutablePropertyDescriptorGridEntry.cs
- BamlStream.cs
- Bits.cs