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
- AutomationProperty.cs
- AutomationPatternInfo.cs
- ToolStripScrollButton.cs
- StylusButton.cs
- ContentOperations.cs
- Button.cs
- DataGridHeadersVisibilityToVisibilityConverter.cs
- ByteStorage.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- Context.cs
- WebPartDescription.cs
- WorkflowServiceHostFactory.cs
- AttributeEmitter.cs
- OrderedDictionary.cs
- NaturalLanguageHyphenator.cs
- WebPartConnectionsCancelEventArgs.cs
- UTF32Encoding.cs
- ContractNamespaceAttribute.cs
- SectionInput.cs
- ContextStaticAttribute.cs
- TimelineGroup.cs
- SingleBodyParameterMessageFormatter.cs
- QuaternionAnimation.cs
- Schema.cs
- HwndKeyboardInputProvider.cs
- PageAsyncTask.cs
- JavascriptXmlWriterWrapper.cs
- ElementHost.cs
- CryptoConfig.cs
- COM2IPerPropertyBrowsingHandler.cs
- Crc32.cs
- GraphicsPath.cs
- DataGridViewCellStyle.cs
- PageBreakRecord.cs
- PointHitTestResult.cs
- SQLSingle.cs
- DataSourceControl.cs
- DataGridColumnCollection.cs
- GregorianCalendar.cs
- UserControl.cs
- ButtonPopupAdapter.cs
- PropertyBuilder.cs
- CompositeCollection.cs
- OperatingSystem.cs
- MdiWindowListItemConverter.cs
- BrowserDefinitionCollection.cs
- RequestDescription.cs
- PropertySegmentSerializer.cs
- OdbcError.cs
- SqlFacetAttribute.cs
- PropertyConverter.cs
- TraceUtils.cs
- GlobalDataBindingHandler.cs
- XmlDocumentType.cs
- SQLInt16.cs
- BoundingRectTracker.cs
- ProfilePropertySettingsCollection.cs
- SettingsSection.cs
- XsdBuilder.cs
- CompilationUnit.cs
- DependencyPropertyDescriptor.cs
- XmlReaderSettings.cs
- PageEventArgs.cs
- CorrelationTokenInvalidatedHandler.cs
- CodeDomSerializationProvider.cs
- x509store.cs
- ConfigXmlSignificantWhitespace.cs
- CapabilitiesPattern.cs
- PackageProperties.cs
- TypeGenericEnumerableViewSchema.cs
- ImageAutomationPeer.cs
- Point3D.cs
- CodeLinePragma.cs
- ResourceAttributes.cs
- DbConnectionPool.cs
- BuildProviderCollection.cs
- Validator.cs
- DragAssistanceManager.cs
- PropertyChangedEventArgs.cs
- PixelFormat.cs
- GatewayIPAddressInformationCollection.cs
- DataBoundLiteralControl.cs
- UntrustedRecipientException.cs
- EntityDataSourceDesigner.cs
- ManagementEventWatcher.cs
- MappingModelBuildProvider.cs
- NavigatorOutput.cs
- TemplateParser.cs
- SQLDecimalStorage.cs
- ChangePassword.cs
- EntitySetRetriever.cs
- SQLString.cs
- ArglessEventHandlerProxy.cs
- DesignerListAdapter.cs
- NaturalLanguageHyphenator.cs
- ColorAnimationBase.cs
- AuthorizationSection.cs
- BuildDependencySet.cs
- RangeValidator.cs
- CodeCastExpression.cs