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
- XpsManager.cs
- ReflectionServiceProvider.cs
- WebPartHeaderCloseVerb.cs
- DrawingContextDrawingContextWalker.cs
- EventDescriptor.cs
- BitVec.cs
- ResourceDictionaryCollection.cs
- ScaleTransform3D.cs
- ActivityWithResult.cs
- DigitShape.cs
- TextEvent.cs
- DefaultSection.cs
- WSHttpBindingCollectionElement.cs
- XmlTextAttribute.cs
- PlainXmlWriter.cs
- ToolStripPanelCell.cs
- TextAnchor.cs
- Model3D.cs
- CapabilitiesSection.cs
- XmlNamedNodeMap.cs
- ExpressionBuilderContext.cs
- SymbolType.cs
- DataSourceControl.cs
- TransactedBatchContext.cs
- SqlException.cs
- GroupItemAutomationPeer.cs
- TrackingServices.cs
- PersistenceTypeAttribute.cs
- EFAssociationProvider.cs
- LinqExpressionNormalizer.cs
- PromptBuilder.cs
- XPathNodeIterator.cs
- TextBoxBase.cs
- ViewManager.cs
- _NestedMultipleAsyncResult.cs
- LinqDataSourceSelectEventArgs.cs
- RegexCaptureCollection.cs
- DataGridViewComboBoxEditingControl.cs
- DataGridViewRowConverter.cs
- SolidColorBrush.cs
- WebBrowserProgressChangedEventHandler.cs
- StreamSecurityUpgradeAcceptorAsyncResult.cs
- DbConnectionPoolGroup.cs
- RulePatternOps.cs
- QueryOutputWriter.cs
- RelationshipWrapper.cs
- DecodeHelper.cs
- HtmlSelectionListAdapter.cs
- HyperLinkDataBindingHandler.cs
- CharEnumerator.cs
- DataServiceContext.cs
- QueryStringHandler.cs
- PrintController.cs
- FileResponseElement.cs
- CutCopyPasteHelper.cs
- SchemaNamespaceManager.cs
- WSHttpSecurityElement.cs
- ToolBarButton.cs
- ObjectParameter.cs
- InternalConfigEventArgs.cs
- ImageCodecInfo.cs
- ApplyHostConfigurationBehavior.cs
- PasswordPropertyTextAttribute.cs
- ObjectListCommand.cs
- ISCIIEncoding.cs
- TransformValueSerializer.cs
- FileInfo.cs
- Rect3DValueSerializer.cs
- StandardBindingImporter.cs
- SmiSettersStream.cs
- TabItemAutomationPeer.cs
- SafeCoTaskMem.cs
- ActivityWithResultValueSerializer.cs
- DbConnectionInternal.cs
- CheckPair.cs
- TreeView.cs
- PathFigureCollectionValueSerializer.cs
- XPathPatternParser.cs
- RuleSetCollection.cs
- SpeechAudioFormatInfo.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- LineUtil.cs
- VariableAction.cs
- MessageQueueEnumerator.cs
- WorkflowCreationContext.cs
- Viewport3DVisual.cs
- HybridObjectCache.cs
- StaticSiteMapProvider.cs
- ConstantSlot.cs
- NamespaceCollection.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- AtomServiceDocumentSerializer.cs
- LocatorPartList.cs
- BooleanStorage.cs
- SqlDataSourceConfigureSortForm.cs
- ConfigXmlAttribute.cs
- RNGCryptoServiceProvider.cs
- PointCollection.cs
- LocatorPart.cs
- PropertyManager.cs