Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Permissions / GACIdentityPermission.cs / 1305376 / GACIdentityPermission.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // GacIdentityPermission.cs // //[....] // namespace System.Security.Permissions { using System; #if FEATURE_CAS_POLICY using SecurityElement = System.Security.SecurityElement; #endif // FEATURE_CAS_POLICY using System.Globalization; [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )] [System.Runtime.InteropServices.ComVisible(true)] [Serializable] sealed public class GacIdentityPermissionAttribute : CodeAccessSecurityAttribute { public GacIdentityPermissionAttribute( SecurityAction action ) : base( action ) { } public override IPermission CreatePermission() { return new GacIdentityPermission(); } } [System.Runtime.InteropServices.ComVisible(true)] [Serializable] sealed public class GacIdentityPermission : CodeAccessPermission, IBuiltInPermission { //------------------------------------------------------ // // PUBLIC CONSTRUCTORS // //----------------------------------------------------- public GacIdentityPermission(PermissionState state) { if (state != PermissionState.Unrestricted && state != PermissionState.None) { throw new ArgumentException(Environment.GetResourceString("Argument_InvalidPermissionState")); } } public GacIdentityPermission() { } //----------------------------------------------------- // // IPERMISSION IMPLEMENTATION // //----------------------------------------------------- public override IPermission Copy() { return new GacIdentityPermission(); } public override bool IsSubsetOf(IPermission target) { if (target == null) return false; if (!(target is GacIdentityPermission)) throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName)); return true; } public override IPermission Intersect(IPermission target) { if (target == null) return null; if (!(target is GacIdentityPermission)) throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName)); return this.Copy(); } public override IPermission Union(IPermission target) { if (target == null) return this.Copy(); if (!(target is GacIdentityPermission)) throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName)); return this.Copy(); } #if FEATURE_CAS_POLICY public override SecurityElement ToXml() { SecurityElement securityElement = CodeAccessPermission.CreatePermissionElement( this, "System.Security.Permissions.GacIdentityPermission" ); return securityElement; } public override void FromXml(SecurityElement securityElement) { CodeAccessPermission.ValidateElement(securityElement, this); } #endif // FEATURE_CAS_POLICY ///int IBuiltInPermission.GetTokenIndex() { return GacIdentityPermission.GetTokenIndex(); } internal static int GetTokenIndex() { return BuiltInPermissionIndex.GacIdentityPermissionIndex; } } } // 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
- SelectionHighlightInfo.cs
- TemplateBamlRecordReader.cs
- AuthenticationModuleElement.cs
- AllowedAudienceUriElement.cs
- ConsoleCancelEventArgs.cs
- ReversePositionQuery.cs
- XmlSchemaValidator.cs
- BasePattern.cs
- ScriptModule.cs
- HitTestParameters.cs
- DataTableNewRowEvent.cs
- SettingsSection.cs
- PropertyValueUIItem.cs
- ValidatorAttribute.cs
- UnsafeNativeMethods.cs
- ToolTipService.cs
- TableItemProviderWrapper.cs
- OleDbSchemaGuid.cs
- WinInet.cs
- ListViewItemMouseHoverEvent.cs
- KeySpline.cs
- ContentType.cs
- BuildProvidersCompiler.cs
- RIPEMD160Managed.cs
- MSAAEventDispatcher.cs
- CheckBoxBaseAdapter.cs
- DocumentReferenceCollection.cs
- AssertUtility.cs
- TextRangeAdaptor.cs
- XPathNodeIterator.cs
- ClientSettingsSection.cs
- ContextTokenTypeConverter.cs
- ParentUndoUnit.cs
- EntityContainerAssociationSetEnd.cs
- ExtendedPropertyDescriptor.cs
- DataGridViewElement.cs
- FirstMatchCodeGroup.cs
- _ListenerRequestStream.cs
- CollectionBuilder.cs
- DataStreamFromComStream.cs
- SqlUserDefinedAggregateAttribute.cs
- OpenFileDialog.cs
- FreeIndexList.cs
- KeyValueConfigurationElement.cs
- compensatingcollection.cs
- NativeConfigurationLoader.cs
- ScriptResourceAttribute.cs
- AuthenticationConfig.cs
- StrokeDescriptor.cs
- XmlSignificantWhitespace.cs
- DirectoryInfo.cs
- ColumnHeader.cs
- MarginCollapsingState.cs
- EntitySetBaseCollection.cs
- CommandDevice.cs
- OdbcReferenceCollection.cs
- ZoneIdentityPermission.cs
- XPathMessageFilterElement.cs
- WindowPattern.cs
- _BaseOverlappedAsyncResult.cs
- SqlMethodTransformer.cs
- TextElement.cs
- TraceSection.cs
- MailDefinitionBodyFileNameEditor.cs
- DbRetry.cs
- NullableBoolConverter.cs
- StickyNote.cs
- UnsignedPublishLicense.cs
- ValueProviderWrapper.cs
- ConvertTextFrag.cs
- SpellerInterop.cs
- XmlSchemaRedefine.cs
- DefaultMergeHelper.cs
- DockPatternIdentifiers.cs
- EntityDataSourceState.cs
- CanExecuteRoutedEventArgs.cs
- OleDbCommand.cs
- ToolStripButton.cs
- LineInfo.cs
- PerformanceCounterPermissionEntry.cs
- LicenseException.cs
- VisualTarget.cs
- CodeMemberMethod.cs
- AssemblyHash.cs
- InputLanguageProfileNotifySink.cs
- WindowsAltTab.cs
- GlyphRun.cs
- ExtensibleClassFactory.cs
- SQLSingleStorage.cs
- namescope.cs
- CacheMemory.cs
- DataContractSerializerSection.cs
- isolationinterop.cs
- TextServicesCompartmentContext.cs
- SymLanguageVendor.cs
- GridViewDeletedEventArgs.cs
- AmbientEnvironment.cs
- Privilege.cs
- ImpersonationOption.cs
- SqlStream.cs