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
- MenuAdapter.cs
- CalculatedColumn.cs
- Win32PrintDialog.cs
- MetafileEditor.cs
- NativeCompoundFileAPIs.cs
- SqlClientWrapperSmiStream.cs
- HtmlInputButton.cs
- EventLogPermissionEntryCollection.cs
- MetadataUtilsSmi.cs
- XPSSignatureDefinition.cs
- BevelBitmapEffect.cs
- ProfessionalColors.cs
- TextInfo.cs
- BigInt.cs
- ReadOnlyTernaryTree.cs
- Substitution.cs
- IPPacketInformation.cs
- ListView.cs
- CalendarAutoFormatDialog.cs
- DesignerTextWriter.cs
- PingReply.cs
- StatusBarPanelClickEvent.cs
- EdmProperty.cs
- EmptyEnumerable.cs
- HashRepartitionEnumerator.cs
- PatternMatcher.cs
- Compiler.cs
- WindowsListViewScroll.cs
- SafeReadContext.cs
- HtmlPageAdapter.cs
- Stopwatch.cs
- SemanticKeyElement.cs
- AppModelKnownContentFactory.cs
- HorizontalAlignConverter.cs
- WebPartEditorOkVerb.cs
- HyperLinkColumn.cs
- HostingPreferredMapPath.cs
- XmlToDatasetMap.cs
- PolyLineSegment.cs
- GeometryGroup.cs
- NumericExpr.cs
- Registry.cs
- ReadWriteSpinLock.cs
- ToolStripDropDownClosedEventArgs.cs
- SeekStoryboard.cs
- XmlDataDocument.cs
- SafeNativeMethodsMilCoreApi.cs
- SQLMoneyStorage.cs
- GridItemProviderWrapper.cs
- SimpleModelProvider.cs
- DataExpression.cs
- SingleAnimationUsingKeyFrames.cs
- Rect3D.cs
- BindingExpressionBase.cs
- columnmapfactory.cs
- bidPrivateBase.cs
- TreeViewTemplateSelector.cs
- InputManager.cs
- RegisteredArrayDeclaration.cs
- StyleHelper.cs
- MailMessage.cs
- Int32Storage.cs
- Style.cs
- DataGridViewComboBoxColumnDesigner.cs
- CodeGeneratorOptions.cs
- WebPartTransformerCollection.cs
- SimpleColumnProvider.cs
- Track.cs
- ObjectItemCollection.cs
- XPathSelfQuery.cs
- DataMemberAttribute.cs
- ScaleTransform3D.cs
- ExpressionHelper.cs
- VoiceChangeEventArgs.cs
- SuppressMergeCheckAttribute.cs
- CompilationSection.cs
- ButtonBase.cs
- TraceSwitch.cs
- StringFormat.cs
- FixedHighlight.cs
- ForwardPositionQuery.cs
- PenThread.cs
- ViewgenGatekeeper.cs
- FillBehavior.cs
- MetadataPropertyCollection.cs
- SmiMetaData.cs
- TemplateControlParser.cs
- Byte.cs
- ClickablePoint.cs
- WebControl.cs
- SqlDelegatedTransaction.cs
- DrawingGroup.cs
- AttachInfo.cs
- CapacityStreamGeometryContext.cs
- Guid.cs
- DynamicValueConverter.cs
- DateTimeAutomationPeer.cs
- ProcessHostFactoryHelper.cs
- JsonWriter.cs
- DataControlFieldCell.cs