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
- OrthographicCamera.cs
- printdlgexmarshaler.cs
- BStrWrapper.cs
- OciEnlistContext.cs
- QueryOutputWriter.cs
- InternalTypeHelper.cs
- Boolean.cs
- MachineKeySection.cs
- WaitHandleCannotBeOpenedException.cs
- XsdBuilder.cs
- PointLight.cs
- PreservationFileWriter.cs
- TreeNode.cs
- ExtentJoinTreeNode.cs
- WorkflowInstance.cs
- ImpersonationContext.cs
- PointAnimationClockResource.cs
- QueueProcessor.cs
- RegexCompilationInfo.cs
- PtsHost.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- RoutedEventConverter.cs
- TransformerInfo.cs
- InfoCardServiceInstallComponent.cs
- PointLight.cs
- ByteKeyFrameCollection.cs
- SemanticBasicElement.cs
- BitmapEffectGeneralTransform.cs
- DataServiceConfiguration.cs
- HierarchicalDataBoundControl.cs
- DataListDesigner.cs
- PropertiesTab.cs
- FormattedText.cs
- ServiceMetadataPublishingElement.cs
- NegatedConstant.cs
- Image.cs
- GraphicsContext.cs
- NotifyInputEventArgs.cs
- DebugView.cs
- HtmlTable.cs
- IPPacketInformation.cs
- SyndicationFeedFormatter.cs
- BoolExpr.cs
- SubMenuStyleCollectionEditor.cs
- ISAPIRuntime.cs
- NameValuePair.cs
- TaskSchedulerException.cs
- WhitespaceRuleLookup.cs
- ExpressionBindings.cs
- Events.cs
- FileCodeGroup.cs
- TextSelectionProcessor.cs
- WizardStepCollectionEditor.cs
- Trace.cs
- httpstaticobjectscollection.cs
- AuthenticationSection.cs
- Selection.cs
- HttpCachePolicy.cs
- FixedSOMSemanticBox.cs
- TableLayoutCellPaintEventArgs.cs
- SchemaAttDef.cs
- IconEditor.cs
- ElementHostPropertyMap.cs
- TextRunProperties.cs
- QuerySelectOp.cs
- RecognizedAudio.cs
- ModulesEntry.cs
- XPathNodeList.cs
- TableAdapterManagerNameHandler.cs
- SystemTcpConnection.cs
- ImageField.cs
- DesignTimeTemplateParser.cs
- CurrencyManager.cs
- SoapIncludeAttribute.cs
- PropertyInformation.cs
- BlurBitmapEffect.cs
- RegexReplacement.cs
- ReadOnlyPropertyMetadata.cs
- EditorResources.cs
- OdbcConnectionString.cs
- ValueProviderWrapper.cs
- Char.cs
- objectquery_tresulttype.cs
- HtmlTableRow.cs
- IDispatchConstantAttribute.cs
- XmlWrappingWriter.cs
- GridToolTip.cs
- ToolboxItemFilterAttribute.cs
- SystemDiagnosticsSection.cs
- FormDesigner.cs
- SoapMessage.cs
- XmlCharCheckingReader.cs
- XmlTypeMapping.cs
- clipboard.cs
- MessageQueueEnumerator.cs
- EnumBuilder.cs
- AspNetSynchronizationContext.cs
- LocalFileSettingsProvider.cs
- ObjectIDGenerator.cs
- RemotingConfiguration.cs