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
- Setter.cs
- AutoGeneratedFieldProperties.cs
- MatrixAnimationUsingPath.cs
- XmlCharacterData.cs
- DataViewSetting.cs
- EdmFunctionAttribute.cs
- TableStyle.cs
- FixUp.cs
- PointHitTestParameters.cs
- SByteConverter.cs
- QueueProcessor.cs
- ContextStaticAttribute.cs
- TypeConstant.cs
- ErrorFormatterPage.cs
- UserControl.cs
- ChannelCacheSettings.cs
- ScalarType.cs
- RecoverInstanceLocksCommand.cs
- CookieParameter.cs
- TdsValueSetter.cs
- SqlCaseSimplifier.cs
- CodeTryCatchFinallyStatement.cs
- XPathDescendantIterator.cs
- CodeRemoveEventStatement.cs
- LocatorManager.cs
- PhysicalOps.cs
- GridViewDeleteEventArgs.cs
- ManagementBaseObject.cs
- CookielessHelper.cs
- Clipboard.cs
- CssTextWriter.cs
- Condition.cs
- ClientScriptManagerWrapper.cs
- ByteConverter.cs
- PropertyInfoSet.cs
- BitmapDecoder.cs
- WebConfigurationManager.cs
- IResourceProvider.cs
- ExclusiveHandleList.cs
- VirtualPath.cs
- CredentialCache.cs
- MatrixConverter.cs
- StorageBasedPackageProperties.cs
- xdrvalidator.cs
- Queue.cs
- LineBreakRecord.cs
- ContravarianceAdapter.cs
- HtmlInputControl.cs
- TextMessageEncoder.cs
- PropertyChangedEventArgs.cs
- PropertyManager.cs
- IndicFontClient.cs
- PreservationFileReader.cs
- EmptyControlCollection.cs
- LinqDataSourceUpdateEventArgs.cs
- Stack.cs
- Stylesheet.cs
- DrawingAttributeSerializer.cs
- WebPartManagerInternals.cs
- InstanceDescriptor.cs
- ComponentManagerBroker.cs
- NamespaceEmitter.cs
- DragStartedEventArgs.cs
- DropShadowBitmapEffect.cs
- NameHandler.cs
- SmtpMail.cs
- Overlapped.cs
- WebBaseEventKeyComparer.cs
- ServicePerformanceCounters.cs
- DesignTimeTemplateParser.cs
- Encoder.cs
- TransactionProtocolConverter.cs
- MostlySingletonList.cs
- SettingsPropertyIsReadOnlyException.cs
- MDIWindowDialog.cs
- ByteStorage.cs
- Invariant.cs
- DropSource.cs
- SQLBoolean.cs
- InputReferenceExpression.cs
- GACMembershipCondition.cs
- TraversalRequest.cs
- _IPv4Address.cs
- FixedSOMPageConstructor.cs
- TTSEvent.cs
- ConnectionPoint.cs
- ImageFormat.cs
- SQLMembershipProvider.cs
- SemanticResultKey.cs
- HuffCodec.cs
- CallbackException.cs
- Constants.cs
- FormsAuthenticationUser.cs
- XPathDocumentIterator.cs
- Transactions.cs
- Pair.cs
- ParseChildrenAsPropertiesAttribute.cs
- PointIndependentAnimationStorage.cs
- AsymmetricKeyExchangeFormatter.cs
- CmsInterop.cs