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
- FixedBufferAttribute.cs
- ListBoxItemWrapperAutomationPeer.cs
- StrongNamePublicKeyBlob.cs
- ContractType.cs
- TokenBasedSet.cs
- XmlNamespaceMapping.cs
- LicenseException.cs
- SimpleHandlerFactory.cs
- MaskedTextBox.cs
- DesignTimeDataBinding.cs
- CompensatableTransactionScopeActivityDesigner.cs
- EncoderReplacementFallback.cs
- DesignSurfaceEvent.cs
- XmlChildNodes.cs
- InboundActivityHelper.cs
- EnumerableRowCollection.cs
- TabRenderer.cs
- WindowsListViewGroupHelper.cs
- InkCanvasSelection.cs
- DataGrid.cs
- IssuedTokensHeader.cs
- ServerIdentity.cs
- ReflectPropertyDescriptor.cs
- TypeNameHelper.cs
- UniqueConstraint.cs
- CompleteWizardStep.cs
- HtmlContainerControl.cs
- SchemaDeclBase.cs
- DocumentsTrace.cs
- SelectionItemProviderWrapper.cs
- ToolBarButtonClickEvent.cs
- ChameleonKey.cs
- RC2.cs
- LinearGradientBrush.cs
- Vector3DAnimationBase.cs
- MetadataUtil.cs
- _AutoWebProxyScriptEngine.cs
- TreeViewEvent.cs
- ValidateNames.cs
- XComponentModel.cs
- IsolatedStorage.cs
- SpecularMaterial.cs
- AppDomainAttributes.cs
- Decimal.cs
- CodeCommentStatement.cs
- AliasedSlot.cs
- WebControlParameterProxy.cs
- AutoSizeComboBox.cs
- SettingsBindableAttribute.cs
- SoapRpcMethodAttribute.cs
- CodeDirectoryCompiler.cs
- FaultDescription.cs
- TraceContextRecord.cs
- TemplatePartAttribute.cs
- Application.cs
- Utils.cs
- WebPartPersonalization.cs
- HostingEnvironment.cs
- AsyncStreamReader.cs
- CodeAttributeArgument.cs
- XmlRootAttribute.cs
- PartialTrustHelpers.cs
- StringConverter.cs
- PropertyDescriptor.cs
- TagPrefixCollection.cs
- SerTrace.cs
- MatrixCamera.cs
- Int64.cs
- BoolExpressionVisitors.cs
- WebBrowser.cs
- RelationshipType.cs
- WebPartUtil.cs
- ToolStripTextBox.cs
- URLAttribute.cs
- MultipleViewPattern.cs
- TextDecoration.cs
- ScrollBarRenderer.cs
- LayoutInformation.cs
- DataGridGeneralPage.cs
- WebPartZoneBase.cs
- AggregateNode.cs
- DocumentEventArgs.cs
- XmlLanguageConverter.cs
- GridViewAutomationPeer.cs
- ImageAttributes.cs
- IntegerValidatorAttribute.cs
- base64Transforms.cs
- DuplicateWaitObjectException.cs
- ResourceReferenceExpression.cs
- InputReport.cs
- NotSupportedException.cs
- OleDbErrorCollection.cs
- EventTrigger.cs
- mediaeventargs.cs
- DrawingCollection.cs
- CommonEndpointBehaviorElement.cs
- AuthenticationManager.cs
- XslCompiledTransform.cs
- CodeConditionStatement.cs
- UniqueID.cs