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
- BamlVersionHeader.cs
- WebPartEditorApplyVerb.cs
- CqlErrorHelper.cs
- StateWorkerRequest.cs
- TextEffect.cs
- DbConnectionInternal.cs
- WebPartDeleteVerb.cs
- ThreadInterruptedException.cs
- SQLResource.cs
- DataGridViewComboBoxCell.cs
- QilStrConcatenator.cs
- TextLineResult.cs
- SqlDataRecord.cs
- EmbeddedMailObjectCollectionEditor.cs
- RootBrowserWindowProxy.cs
- PhoneCall.cs
- DataGridAutomationPeer.cs
- SimpleExpression.cs
- AddInEnvironment.cs
- LocalValueEnumerator.cs
- SynchronizationLockException.cs
- InvokePattern.cs
- TemplateBamlTreeBuilder.cs
- _OverlappedAsyncResult.cs
- WebEventTraceProvider.cs
- Control.cs
- RecognizedPhrase.cs
- HebrewCalendar.cs
- Registration.cs
- CommandManager.cs
- FilteredDataSetHelper.cs
- SqlPersonalizationProvider.cs
- SerialStream.cs
- CookielessHelper.cs
- GlyphRunDrawing.cs
- DynamicEntity.cs
- DetailsViewRow.cs
- UniqueIdentifierService.cs
- DecimalFormatter.cs
- PageParser.cs
- MessageLogTraceRecord.cs
- EventSinkActivity.cs
- WindowsBrush.cs
- RightsManagementInformation.cs
- SystemDiagnosticsSection.cs
- UnorderedHashRepartitionStream.cs
- ProtocolsConfigurationEntry.cs
- ServiceSettingsResponseInfo.cs
- CodeMethodInvokeExpression.cs
- NonNullItemCollection.cs
- DataProtection.cs
- LogConverter.cs
- LazyTextWriterCreator.cs
- EmptyStringExpandableObjectConverter.cs
- WasNotInstalledException.cs
- LinkClickEvent.cs
- CustomMenuItemCollection.cs
- Shared.cs
- ScrollProperties.cs
- WebScriptMetadataMessageEncoderFactory.cs
- HttpDateParse.cs
- Site.cs
- VideoDrawing.cs
- AuthenticationConfig.cs
- DictionaryContent.cs
- WebPartDescription.cs
- Encoder.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- TargetPerspective.cs
- AsyncCompletedEventArgs.cs
- DecimalStorage.cs
- RectIndependentAnimationStorage.cs
- TaskbarItemInfo.cs
- QueryCacheKey.cs
- WebPartHelpVerb.cs
- CounterCreationDataCollection.cs
- CollectionEditor.cs
- DrawingContextWalker.cs
- AssignDesigner.xaml.cs
- Transform.cs
- ValueExpressions.cs
- BufferBuilder.cs
- ControlValuePropertyAttribute.cs
- CheckBoxField.cs
- OdbcFactory.cs
- TaiwanLunisolarCalendar.cs
- ListViewTableRow.cs
- ScriptingJsonSerializationSection.cs
- SoapHttpTransportImporter.cs
- WebAdminConfigurationHelper.cs
- TextServicesManager.cs
- DefaultEventAttribute.cs
- DetailsViewRowCollection.cs
- QueuePropertyVariants.cs
- CollectionViewGroupInternal.cs
- SqlStatistics.cs
- QilTernary.cs
- XmlSchemaFacet.cs
- SerializationEventsCache.cs
- ConvertTextFrag.cs