Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Policy / GACMembershipCondition.cs / 1305376 / 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; using System.Diagnostics.Contracts; [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; return evidence.GetHostEvidence() != null; } 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" ) ); Contract.EndContractBlock(); } 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; using System.Diagnostics.Contracts; [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; return evidence.GetHostEvidence() != null; } 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" ) ); Contract.EndContractBlock(); } 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
- ControlIdConverter.cs
- TableLayoutColumnStyleCollection.cs
- MetafileEditor.cs
- CalendarDateChangedEventArgs.cs
- MsmqIntegrationInputMessage.cs
- StateValidator.cs
- VisualTreeHelper.cs
- HostingPreferredMapPath.cs
- BuilderPropertyEntry.cs
- DataSysAttribute.cs
- NativeWindow.cs
- QueueException.cs
- UnicodeEncoding.cs
- TrustSection.cs
- BuildDependencySet.cs
- SQLInt64.cs
- ComplexType.cs
- ErrorProvider.cs
- JsonServiceDocumentSerializer.cs
- GridItemPattern.cs
- TraceSource.cs
- DBCommandBuilder.cs
- StaticFileHandler.cs
- SystemNetHelpers.cs
- InputScopeAttribute.cs
- MatrixCamera.cs
- ClickablePoint.cs
- TypeLibConverter.cs
- TextTreeNode.cs
- XXXInfos.cs
- CustomSignedXml.cs
- AuthenticationService.cs
- Statements.cs
- WMIGenerator.cs
- BuildTopDownAttribute.cs
- RegionData.cs
- ContextBase.cs
- CheckBox.cs
- GlyphRun.cs
- translator.cs
- WebBaseEventKeyComparer.cs
- TextReturnReader.cs
- CallTemplateAction.cs
- ObjectDataSourceDisposingEventArgs.cs
- QueueProcessor.cs
- Int32Rect.cs
- ClientBuildManagerCallback.cs
- ScriptRef.cs
- XmlCountingReader.cs
- MetadataArtifactLoaderComposite.cs
- PointAnimation.cs
- SpotLight.cs
- ImageFormatConverter.cs
- KerberosTokenFactoryCredential.cs
- BindableTemplateBuilder.cs
- AccessDataSourceView.cs
- AutoResetEvent.cs
- ConnectionManagementElement.cs
- DbConnectionStringBuilder.cs
- RadioButtonAutomationPeer.cs
- HandledEventArgs.cs
- LocalFileSettingsProvider.cs
- StoreContentChangedEventArgs.cs
- PeerInvitationResponse.cs
- CompatibleIComparer.cs
- ProfileBuildProvider.cs
- TemplatedWizardStep.cs
- FieldAccessException.cs
- StylusCaptureWithinProperty.cs
- DesignerView.xaml.cs
- Sentence.cs
- DefaultAutoFieldGenerator.cs
- BrowsableAttribute.cs
- ConfigurationStrings.cs
- ContractListAdapter.cs
- assertwrapper.cs
- ItemDragEvent.cs
- FormViewPagerRow.cs
- DataServiceException.cs
- MemberPath.cs
- CellParagraph.cs
- DbConnectionPoolOptions.cs
- IISMapPath.cs
- RegistryKey.cs
- adornercollection.cs
- InternalPermissions.cs
- DesignerTransactionCloseEvent.cs
- InfoCardTraceRecord.cs
- XmlCodeExporter.cs
- DesignTable.cs
- ThicknessKeyFrameCollection.cs
- PerformanceCounterNameAttribute.cs
- Expressions.cs
- ClientTargetSection.cs
- LogicalExpr.cs
- CodeBlockBuilder.cs
- Char.cs
- SafeBitVector32.cs
- CodeLabeledStatement.cs
- FlowchartSizeFeature.cs