Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Security / Policy / GACMembershipCondition.cs / 1 / GACMembershipCondition.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // GacMembershipCondition.cs // // Implementation of membership condition for being in the Gac // namespace System.Security.Policy { using System; using System.Collections; using System.Globalization; [Serializable] [System.Runtime.InteropServices.ComVisible(true)] sealed public class GacMembershipCondition : IMembershipCondition, IConstantMembershipCondition { //------------------------------------------------------ // // PUBLIC CONSTRUCTORS // //----------------------------------------------------- public GacMembershipCondition() { } //----------------------------------------------------- // // IMEMBERSHIPCONDITION IMPLEMENTATION // //----------------------------------------------------- public bool Check( Evidence evidence ) { if (evidence == null) return false; IEnumerator enumerator = evidence.GetHostEnumerator(); while (enumerator.MoveNext()) { Object obj = enumerator.Current; if (obj is GacInstalled) return true; } return false; } public IMembershipCondition Copy() { return new GacMembershipCondition(); } public SecurityElement ToXml() { return ToXml( null ); } public void FromXml( SecurityElement e ) { FromXml( e, null ); } public SecurityElement ToXml( PolicyLevel level ) { SecurityElement root = new SecurityElement( "IMembershipCondition" ); System.Security.Util.XMLUtil.AddClassAttribute( root, this.GetType(), this.GetType().FullName ); root.AddAttribute( "version", "1" ); return root; } public void FromXml( SecurityElement e, PolicyLevel level ) { if (e == null) throw new ArgumentNullException("e"); if (!e.Tag.Equals( "IMembershipCondition" )) throw new ArgumentException( Environment.GetResourceString( "Argument_MembershipConditionElement" ) ); } public override bool Equals( Object o ) { GacMembershipCondition that = (o as GacMembershipCondition); if (that != null) return true; return false; } public override int GetHashCode() { return 0; } public override String ToString() { return Environment.GetResourceString( "GAC_ToString" ); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TextEditorSpelling.cs
- ApplyTemplatesAction.cs
- ObservableDictionary.cs
- BitmapDecoder.cs
- DataListCommandEventArgs.cs
- TableLayoutPanelCellPosition.cs
- COM2ExtendedBrowsingHandler.cs
- SemaphoreFullException.cs
- TextTreeDeleteContentUndoUnit.cs
- FaultConverter.cs
- SerialPinChanges.cs
- RepeaterDataBoundAdapter.cs
- TransactionFlowBindingElementImporter.cs
- dataprotectionpermissionattribute.cs
- ExtensionDataReader.cs
- ByteAnimationUsingKeyFrames.cs
- HttpApplicationFactory.cs
- ReachDocumentPageSerializerAsync.cs
- TdsParameterSetter.cs
- PipelineModuleStepContainer.cs
- FrameworkContentElement.cs
- HttpHandlerActionCollection.cs
- XmlArrayItemAttributes.cs
- X509Utils.cs
- ProtectedConfigurationProviderCollection.cs
- XmlNodeList.cs
- UrlMappingsModule.cs
- TrailingSpaceComparer.cs
- GeometryGroup.cs
- COM2IProvidePropertyBuilderHandler.cs
- WebPartHelpVerb.cs
- Thread.cs
- SchemaConstraints.cs
- WindowCollection.cs
- JsonEnumDataContract.cs
- ContainerVisual.cs
- SoapProtocolReflector.cs
- PageCatalogPart.cs
- FixedSOMPageElement.cs
- MenuRendererStandards.cs
- HitTestParameters.cs
- Italic.cs
- ObjectItemAttributeAssemblyLoader.cs
- GenerateTemporaryAssemblyTask.cs
- bindurihelper.cs
- SoapMessage.cs
- Deflater.cs
- XmlUrlResolver.cs
- RightsManagementEncryptedStream.cs
- AbstractDataSvcMapFileLoader.cs
- SoapReflectionImporter.cs
- OleServicesContext.cs
- ItemsPresenter.cs
- XmlCustomFormatter.cs
- DataControlHelper.cs
- PhysicalOps.cs
- KnowledgeBase.cs
- TextRangeSerialization.cs
- PrimarySelectionAdorner.cs
- ServiceSecurityContext.cs
- ToolStripPanelCell.cs
- SmtpLoginAuthenticationModule.cs
- Pair.cs
- NavigateEvent.cs
- FlowDocumentReader.cs
- UTF32Encoding.cs
- ScalarConstant.cs
- CheckBoxField.cs
- Mouse.cs
- FormViewRow.cs
- PartitionerStatic.cs
- DESCryptoServiceProvider.cs
- DataGridViewImageColumn.cs
- ActivationWorker.cs
- ImageMetadata.cs
- UpdatePanelTriggerCollection.cs
- ScriptResourceHandler.cs
- ZoneMembershipCondition.cs
- DataGridDetailsPresenterAutomationPeer.cs
- remotingproxy.cs
- UdpUtility.cs
- EncoderReplacementFallback.cs
- SurrogateDataContract.cs
- EndpointBehaviorElementCollection.cs
- HttpClientCertificate.cs
- AnonymousIdentificationSection.cs
- SHA256Cng.cs
- Classification.cs
- TextTrailingCharacterEllipsis.cs
- DataViewSettingCollection.cs
- RunClient.cs
- Image.cs
- InvalidOperationException.cs
- FileFormatException.cs
- RawUIStateInputReport.cs
- HttpCookieCollection.cs
- RoutedEventArgs.cs
- SslStream.cs
- PackageFilter.cs
- LinearQuaternionKeyFrame.cs