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
- CollectionChangeEventArgs.cs
- XmlJsonReader.cs
- ObjectDataSourceDisposingEventArgs.cs
- HelpEvent.cs
- MergeExecutor.cs
- InvalidPipelineStoreException.cs
- TypeProvider.cs
- CallTemplateAction.cs
- WSHttpBindingBase.cs
- MethodToken.cs
- ClusterSafeNativeMethods.cs
- CroppedBitmap.cs
- handlecollector.cs
- sqlstateclientmanager.cs
- PropertyGrid.cs
- ConfigXmlCDataSection.cs
- AppDomainProtocolHandler.cs
- UrlPath.cs
- SafeHandles.cs
- EventSetter.cs
- CrossContextChannel.cs
- DataGridViewCell.cs
- WebServiceHostFactory.cs
- WindowsPen.cs
- MappingItemCollection.cs
- DbConnectionStringBuilder.cs
- IsolationInterop.cs
- ProfileService.cs
- FilePrompt.cs
- PageVisual.cs
- ReferencedCollectionType.cs
- FontFamilyValueSerializer.cs
- OutputCacheProfile.cs
- DynamicActivityXamlReader.cs
- _PooledStream.cs
- RijndaelManaged.cs
- SerializableAttribute.cs
- Module.cs
- SimplePropertyEntry.cs
- CTreeGenerator.cs
- PrtCap_Public.cs
- AppModelKnownContentFactory.cs
- HealthMonitoringSectionHelper.cs
- FontFamily.cs
- SHA512.cs
- GCHandleCookieTable.cs
- DeclaredTypeElement.cs
- FloaterParagraph.cs
- XmlWrappingReader.cs
- BaseParaClient.cs
- MetadataExchangeBindings.cs
- Header.cs
- GuidTagList.cs
- FontFamily.cs
- StrokeCollectionDefaultValueFactory.cs
- ContentValidator.cs
- ExtensionDataReader.cs
- SharedStatics.cs
- MemoryRecordBuffer.cs
- TextServicesLoader.cs
- PipelineDeploymentState.cs
- BitmapPalette.cs
- InkCanvasSelectionAdorner.cs
- AccessText.cs
- WrapPanel.cs
- HMACSHA512.cs
- DbParameterCollectionHelper.cs
- ElementUtil.cs
- HttpApplicationFactory.cs
- odbcmetadatacollectionnames.cs
- NamedPipeWorkerProcess.cs
- EventsTab.cs
- InstallerTypeAttribute.cs
- ExpressionEditor.cs
- Contracts.cs
- CollectionBuilder.cs
- ChannelServices.cs
- WorkflowExecutor.cs
- CompressEmulationStream.cs
- MenuItem.cs
- GeometryModel3D.cs
- ClrProviderManifest.cs
- AspNetSynchronizationContext.cs
- ControlAdapter.cs
- ExpressionConverter.cs
- ParameterRefs.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- BamlBinaryReader.cs
- XmlDataCollection.cs
- _RequestLifetimeSetter.cs
- Tablet.cs
- SlotInfo.cs
- ApplyImportsAction.cs
- UTF32Encoding.cs
- EntityType.cs
- HttpListenerResponse.cs
- DateTimeConstantAttribute.cs
- PageContentAsyncResult.cs
- Propagator.Evaluator.cs
- PowerModeChangedEventArgs.cs