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
- httpserverutility.cs
- CustomErrorsSectionWrapper.cs
- DocumentAutomationPeer.cs
- WindowsAuthenticationModule.cs
- HtmlTableCell.cs
- GeometryHitTestParameters.cs
- EncryptedType.cs
- ReflectEventDescriptor.cs
- MemoryFailPoint.cs
- PreviewControlDesigner.cs
- DefaultSerializationProviderAttribute.cs
- PtsCache.cs
- SHA512CryptoServiceProvider.cs
- ControlPager.cs
- SharedHttpsTransportManager.cs
- WebCategoryAttribute.cs
- DataGrid.cs
- ExecutedRoutedEventArgs.cs
- WorkerProcess.cs
- ActivityStatusChangeEventArgs.cs
- TableCell.cs
- storepermission.cs
- WorkflowServiceHost.cs
- SqlDataSource.cs
- PropVariant.cs
- FaultPropagationRecord.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- GridViewRowCollection.cs
- ComplexTypeEmitter.cs
- QueryConverter.cs
- RectKeyFrameCollection.cs
- EntityTransaction.cs
- ChangeNode.cs
- Point3DCollection.cs
- _NegoStream.cs
- InstanceLockQueryResult.cs
- xmlglyphRunInfo.cs
- DataGridViewBand.cs
- FormViewInsertEventArgs.cs
- TTSEngineTypes.cs
- Debug.cs
- GetWinFXPath.cs
- FormatControl.cs
- HttpCachePolicy.cs
- SegmentInfo.cs
- ComponentDesigner.cs
- WindowsEditBox.cs
- FlowchartStart.xaml.cs
- SafeRightsManagementEnvironmentHandle.cs
- ACL.cs
- SmiContextFactory.cs
- NetSectionGroup.cs
- WindowsRichEdit.cs
- ReflectEventDescriptor.cs
- VisualBrush.cs
- CodeExpressionStatement.cs
- Transform3DGroup.cs
- UserMapPath.cs
- NamespaceImport.cs
- WebPartConnection.cs
- XmlChildNodes.cs
- ValidatedControlConverter.cs
- XPathNodeInfoAtom.cs
- WebPartTransformerAttribute.cs
- FileCodeGroup.cs
- DependentList.cs
- OptionalMessageQuery.cs
- DataGridDesigner.cs
- ProfilePropertyMetadata.cs
- XmlCDATASection.cs
- AppDomainManager.cs
- WebPartZoneCollection.cs
- QilName.cs
- Tablet.cs
- Message.cs
- URLString.cs
- CustomWebEventKey.cs
- Stream.cs
- ConstructorExpr.cs
- Encoder.cs
- complextypematerializer.cs
- TreeView.cs
- AdPostCacheSubstitution.cs
- SemanticResolver.cs
- EventManager.cs
- MSAAEventDispatcher.cs
- WebPartUserCapability.cs
- DnsElement.cs
- StaticSiteMapProvider.cs
- ScriptServiceAttribute.cs
- ContextQuery.cs
- ExtensionWindow.cs
- AutoGeneratedField.cs
- SQLDecimal.cs
- ItemsControl.cs
- MetadataPropertyCollection.cs
- TableItemPatternIdentifiers.cs
- TypePresenter.xaml.cs
- UnsafeNativeMethods.cs
- DataGridViewImageColumn.cs