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
- LambdaCompiler.ControlFlow.cs
- HyperLinkColumn.cs
- ControlPropertyNameConverter.cs
- OleDbEnumerator.cs
- XmlQualifiedName.cs
- FloaterBaseParaClient.cs
- TableLayoutPanel.cs
- FixedNode.cs
- VisualStyleTypesAndProperties.cs
- AuthenticationService.cs
- ToolStripItemTextRenderEventArgs.cs
- AutomationElement.cs
- StackOverflowException.cs
- MappingItemCollection.cs
- IndependentAnimationStorage.cs
- FixUpCollection.cs
- MessageSecurityOverMsmqElement.cs
- DependencyPropertyDescriptor.cs
- AdRotator.cs
- OwnerDrawPropertyBag.cs
- KeyValuePair.cs
- QueueProcessor.cs
- SafeRegistryHandle.cs
- TableCell.cs
- BaseTreeIterator.cs
- MyContact.cs
- RunWorkerCompletedEventArgs.cs
- UncommonField.cs
- ByteArrayHelperWithString.cs
- ApplicationCommands.cs
- Single.cs
- WindowsScroll.cs
- DelegateTypeInfo.cs
- DocumentSchemaValidator.cs
- ACE.cs
- MsmqEncryptionAlgorithm.cs
- ListParagraph.cs
- Int32Storage.cs
- PassportAuthenticationEventArgs.cs
- Int64Animation.cs
- CustomValidator.cs
- ChannelFactory.cs
- ValidationService.cs
- DiagnosticsConfigurationHandler.cs
- WeakReference.cs
- TransactionFlowBindingElement.cs
- ServiceHttpHandlerFactory.cs
- PersonalizationEntry.cs
- ColumnMapCopier.cs
- ReferentialConstraint.cs
- GraphicsContext.cs
- PackUriHelper.cs
- ResourceAssociationSetEnd.cs
- Privilege.cs
- EventLogEntry.cs
- CellLabel.cs
- RegexTree.cs
- SmiContext.cs
- ClientScriptManager.cs
- HiddenFieldPageStatePersister.cs
- TransformConverter.cs
- GeometryGroup.cs
- BindToObject.cs
- PropertyPath.cs
- SynchronizingStream.cs
- EncodingInfo.cs
- DetailsViewInsertEventArgs.cs
- DictionaryEditChange.cs
- IpcServerChannel.cs
- StorageAssociationTypeMapping.cs
- XDeferredAxisSource.cs
- Zone.cs
- MemoryStream.cs
- EntityDataSourceQueryBuilder.cs
- TemplateControlParser.cs
- SemanticBasicElement.cs
- Rect.cs
- DataSetMappper.cs
- PreviewPrintController.cs
- _LocalDataStore.cs
- ThreadExceptionEvent.cs
- RewritingSimplifier.cs
- MetaChildrenColumn.cs
- StrokeIntersection.cs
- DbMetaDataFactory.cs
- StateFinalizationActivity.cs
- WebPartEditorApplyVerb.cs
- PinProtectionHelper.cs
- QilScopedVisitor.cs
- FileStream.cs
- VisualTreeHelper.cs
- EntityModelSchemaGenerator.cs
- ForEachAction.cs
- GeometryCombineModeValidation.cs
- DirectoryObjectSecurity.cs
- ResourcePool.cs
- XmlFormatWriterGenerator.cs
- TimeManager.cs
- UnsettableComboBox.cs
- DemultiplexingClientMessageFormatter.cs