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
- CacheHelper.cs
- GridSplitterAutomationPeer.cs
- DataGridCell.cs
- TreeViewEvent.cs
- PhonemeConverter.cs
- InstanceHandle.cs
- TdsParserSessionPool.cs
- FrameworkElementAutomationPeer.cs
- GeneratedContractType.cs
- WindowsMenu.cs
- DataObjectCopyingEventArgs.cs
- GenerateDerivedKeyRequest.cs
- MeasurementDCInfo.cs
- SpotLight.cs
- PartialToken.cs
- MobileUserControl.cs
- PagerSettings.cs
- XmlWellformedWriter.cs
- ListItemParagraph.cs
- RectAnimationClockResource.cs
- CharacterMetrics.cs
- XmlDataProvider.cs
- UrlAuthFailedErrorFormatter.cs
- FixedFindEngine.cs
- BufferedStream2.cs
- BlockUIContainer.cs
- ApplicationServicesHostFactory.cs
- ResourceContainer.cs
- CompleteWizardStep.cs
- DbFunctionCommandTree.cs
- HtmlTableCell.cs
- DataService.cs
- ADRoleFactoryConfiguration.cs
- FlowDocumentFormatter.cs
- ObjectDataSourceEventArgs.cs
- StringExpressionSet.cs
- ProviderSettingsCollection.cs
- QilIterator.cs
- Pair.cs
- ClientSection.cs
- OracleInfoMessageEventArgs.cs
- ButtonFlatAdapter.cs
- ScheduleChanges.cs
- Tag.cs
- IODescriptionAttribute.cs
- ConfigXmlText.cs
- SoapProcessingBehavior.cs
- Empty.cs
- TextOptionsInternal.cs
- ADMembershipUser.cs
- OrderingExpression.cs
- SkipQueryOptionExpression.cs
- X509Certificate.cs
- COM2ExtendedUITypeEditor.cs
- DecryptRequest.cs
- PolyQuadraticBezierSegment.cs
- ColorAnimationBase.cs
- DataControlCommands.cs
- GeneralTransform3DTo2DTo3D.cs
- SpecialFolderEnumConverter.cs
- TraceLevelStore.cs
- DesignerFrame.cs
- WorkflowApplication.cs
- TypeUnloadedException.cs
- HostedHttpContext.cs
- CalculatedColumn.cs
- SqlCachedBuffer.cs
- ParamArrayAttribute.cs
- WindowsButton.cs
- SamlNameIdentifierClaimResource.cs
- ServiceDiscoveryBehavior.cs
- QilChoice.cs
- DWriteFactory.cs
- WpfWebRequestHelper.cs
- EnumerableRowCollection.cs
- MediaTimeline.cs
- XpsImageSerializationService.cs
- ADConnectionHelper.cs
- GeneratedCodeAttribute.cs
- TableProviderWrapper.cs
- XmlComment.cs
- InvalidComObjectException.cs
- XmlChoiceIdentifierAttribute.cs
- AnimationTimeline.cs
- FontStyleConverter.cs
- MemoryFailPoint.cs
- UnsafeNativeMethods.cs
- LambdaCompiler.Generated.cs
- RotateTransform.cs
- ThrowHelper.cs
- HttpVersion.cs
- ConfigurationPropertyAttribute.cs
- OleDbPropertySetGuid.cs
- BooleanKeyFrameCollection.cs
- BrushProxy.cs
- SingleAnimationBase.cs
- Point3DCollection.cs
- ToolStripDropDownButton.cs
- documentsequencetextcontainer.cs
- WindowHideOrCloseTracker.cs