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
- ByteStorage.cs
- Types.cs
- XmlReaderSettings.cs
- EventTask.cs
- ServicePointManagerElement.cs
- _NegoStream.cs
- ReferenceEqualityComparer.cs
- TextElementEnumerator.cs
- XmlRootAttribute.cs
- HostedTransportConfigurationManager.cs
- Transform.cs
- HttpException.cs
- CommonDialog.cs
- RepeaterItemCollection.cs
- TemplateControl.cs
- DataControlFieldHeaderCell.cs
- ManifestSignedXml.cs
- FreezableCollection.cs
- TransactionTraceIdentifier.cs
- FunctionGenerator.cs
- GenericTransactionFlowAttribute.cs
- CreateParams.cs
- AsynchronousChannelMergeEnumerator.cs
- PolicyFactory.cs
- ListViewDeleteEventArgs.cs
- MarkupCompilePass1.cs
- LeaseManager.cs
- CodeVariableReferenceExpression.cs
- ApplicationServicesHostFactory.cs
- IgnoreFlushAndCloseStream.cs
- ObjectAssociationEndMapping.cs
- PeerEndPoint.cs
- returneventsaver.cs
- NavigationFailedEventArgs.cs
- InplaceBitmapMetadataWriter.cs
- PropertyReferenceExtension.cs
- FieldNameLookup.cs
- StreamUpdate.cs
- DbConnectionStringBuilder.cs
- SafeLocalAllocation.cs
- ImpersonateTokenRef.cs
- TemplateKeyConverter.cs
- ListBindingConverter.cs
- ComponentDispatcherThread.cs
- ScriptResourceAttribute.cs
- WmlControlAdapter.cs
- RuleSetBrowserDialog.cs
- CursorInteropHelper.cs
- TransformedBitmap.cs
- FormatException.cs
- Selector.cs
- Error.cs
- XmlSerializerSection.cs
- ServiceModelEnhancedConfigurationElementCollection.cs
- DatePickerTextBox.cs
- CapabilitiesRule.cs
- ResponseStream.cs
- DataObject.cs
- SHA384.cs
- UnsafeCollabNativeMethods.cs
- Mouse.cs
- TdsParserStateObject.cs
- XmlCharCheckingReader.cs
- SoapSchemaExporter.cs
- CodeGeneratorOptions.cs
- CompressEmulationStream.cs
- IconEditor.cs
- PrimitiveCodeDomSerializer.cs
- RemoteWebConfigurationHost.cs
- WebPartConnectionsConnectVerb.cs
- AssemblyAttributesGoHere.cs
- RequestedSignatureDialog.cs
- DependencyObjectPropertyDescriptor.cs
- XmlExpressionDumper.cs
- FrameworkContextData.cs
- DownloadProgressEventArgs.cs
- CurrentChangingEventArgs.cs
- ConstructorNeedsTagAttribute.cs
- ReadOnlyPropertyMetadata.cs
- SymbolUsageManager.cs
- Bits.cs
- FixedSOMFixedBlock.cs
- PresentationAppDomainManager.cs
- Html32TextWriter.cs
- TemplatedAdorner.cs
- MethodAccessException.cs
- WorkflowElementDialogWindow.xaml.cs
- ShutDownListener.cs
- ExceptionValidationRule.cs
- MultiBindingExpression.cs
- WindowsProgressbar.cs
- ProfileSection.cs
- ResourceDisplayNameAttribute.cs
- TaskSchedulerException.cs
- CharEntityEncoderFallback.cs
- StorageAssociationSetMapping.cs
- WebPartZoneBase.cs
- PagerSettings.cs
- RegistryPermission.cs
- FileEnumerator.cs