Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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, IReportMatchMembershipCondition { //------------------------------------------------------ // // PUBLIC CONSTRUCTORS // //----------------------------------------------------- public GacMembershipCondition() { } //----------------------------------------------------- // // IMEMBERSHIPCONDITION IMPLEMENTATION // //----------------------------------------------------- public bool Check( Evidence evidence ) { object usedEvidence = null; return (this as IReportMatchMembershipCondition).Check(evidence, out usedEvidence); } bool IReportMatchMembershipCondition.Check(Evidence evidence, out object usedEvidence) { usedEvidence = null; if (evidence == null) return false; IEnumerator enumerator = evidence.GetHostEnumerator(); while (enumerator.MoveNext()) { Object obj = enumerator.Current; if (obj is GacInstalled) { usedEvidence = obj; 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" ); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // 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, IReportMatchMembershipCondition { //------------------------------------------------------ // // PUBLIC CONSTRUCTORS // //----------------------------------------------------- public GacMembershipCondition() { } //----------------------------------------------------- // // IMEMBERSHIPCONDITION IMPLEMENTATION // //----------------------------------------------------- public bool Check( Evidence evidence ) { object usedEvidence = null; return (this as IReportMatchMembershipCondition).Check(evidence, out usedEvidence); } bool IReportMatchMembershipCondition.Check(Evidence evidence, out object usedEvidence) { usedEvidence = null; if (evidence == null) return false; IEnumerator enumerator = evidence.GetHostEnumerator(); while (enumerator.MoveNext()) { Object obj = enumerator.Current; if (obj is GacInstalled) { usedEvidence = obj; 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" ); } } } // 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
- DtdParser.cs
- _ListenerAsyncResult.cs
- ApplicationFileParser.cs
- CodeSubDirectoriesCollection.cs
- StrokeRenderer.cs
- InstanceOwnerException.cs
- MdiWindowListStrip.cs
- Util.cs
- DefaultBindingPropertyAttribute.cs
- ConnectionStringSettings.cs
- PartManifestEntry.cs
- SystemIPGlobalProperties.cs
- GlobalItem.cs
- HMACRIPEMD160.cs
- StrokeDescriptor.cs
- ListViewUpdatedEventArgs.cs
- DBConnection.cs
- FileSystemEventArgs.cs
- ToolStripSplitStackLayout.cs
- FormsAuthenticationCredentials.cs
- AdRotator.cs
- WindowsImpersonationContext.cs
- DeleteHelper.cs
- RadioButtonBaseAdapter.cs
- DeobfuscatingStream.cs
- Oid.cs
- MasterPage.cs
- M3DUtil.cs
- KeyProperty.cs
- XmlnsDefinitionAttribute.cs
- EventRouteFactory.cs
- XmlException.cs
- HMACRIPEMD160.cs
- UmAlQuraCalendar.cs
- AtlasWeb.Designer.cs
- Timer.cs
- WorkflowTerminatedException.cs
- SecurityException.cs
- ResourcesChangeInfo.cs
- DispatcherFrame.cs
- GenericEnumConverter.cs
- DataGridTableCollection.cs
- Propagator.Evaluator.cs
- SnapLine.cs
- LambdaCompiler.Generated.cs
- ClassHandlersStore.cs
- Identity.cs
- DecoderReplacementFallback.cs
- SubMenuStyleCollectionEditor.cs
- Validator.cs
- ActivityAction.cs
- OracleParameterCollection.cs
- WCFServiceClientProxyGenerator.cs
- ObjectToken.cs
- XmlSchemaRedefine.cs
- OracleDateTime.cs
- DelegateHelpers.cs
- DetailsViewInsertEventArgs.cs
- CompositeCollectionView.cs
- XmlSchemaComplexContentRestriction.cs
- Point3DIndependentAnimationStorage.cs
- Help.cs
- RegexMatchCollection.cs
- SrgsElementFactoryCompiler.cs
- XamlSerializerUtil.cs
- ControlPaint.cs
- WindowsIdentity.cs
- NTAccount.cs
- BooleanFacetDescriptionElement.cs
- XmlWhitespace.cs
- UnknownBitmapDecoder.cs
- TableAdapterManagerHelper.cs
- BufferBuilder.cs
- CachedBitmap.cs
- Trigger.cs
- CustomAttributeFormatException.cs
- ManifestResourceInfo.cs
- ChtmlTextWriter.cs
- RuleSettings.cs
- FixedHighlight.cs
- mediaeventshelper.cs
- Mouse.cs
- ValidatedControlConverter.cs
- VisualCollection.cs
- BuildProviderCollection.cs
- MenuItemAutomationPeer.cs
- PersonalizationProvider.cs
- PublishLicense.cs
- DesignerAttribute.cs
- DockPatternIdentifiers.cs
- PngBitmapEncoder.cs
- WebPartMenuStyle.cs
- DateTimeConstantAttribute.cs
- Match.cs
- SelectionEditingBehavior.cs
- CodePageUtils.cs
- DragDeltaEventArgs.cs
- BlobPersonalizationState.cs
- ProcessHostMapPath.cs
- BinaryNode.cs