Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / clr / src / BCL / System / Security / Policy / AllMembershipCondition.cs / 1 / AllMembershipCondition.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // AllMembershipCondition.cs // // Simple IMembershipCondition implementation that always passes // namespace System.Security.Policy { using System; using System.Security; using System.Security.Util; using System.Security.Permissions; using System.Collections; [Serializable] [System.Runtime.InteropServices.ComVisible(true)] sealed public class AllMembershipCondition : IMembershipCondition, IConstantMembershipCondition, IReportMatchMembershipCondition { public AllMembershipCondition() { } 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; return true; } public IMembershipCondition Copy() { return new AllMembershipCondition(); } public override String ToString() { return Environment.GetResourceString( "All_ToString" ); } 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(), "System.Security.Policy.AllMembershipCondition" ); // If you hit this assert then most likely you are trying to change the name of this class. // This is ok as long as you change the hard coded string above and change the assert below. BCLDebug.Assert( this.GetType().FullName.Equals( "System.Security.Policy.AllMembershipCondition" ), "Class name changed!" ); 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" ) ); } } public override bool Equals( Object o ) { return (o is AllMembershipCondition); } public override int GetHashCode() { return typeof( AllMembershipCondition ).GetHashCode(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // AllMembershipCondition.cs // // Simple IMembershipCondition implementation that always passes // namespace System.Security.Policy { using System; using System.Security; using System.Security.Util; using System.Security.Permissions; using System.Collections; [Serializable] [System.Runtime.InteropServices.ComVisible(true)] sealed public class AllMembershipCondition : IMembershipCondition, IConstantMembershipCondition, IReportMatchMembershipCondition { public AllMembershipCondition() { } 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; return true; } public IMembershipCondition Copy() { return new AllMembershipCondition(); } public override String ToString() { return Environment.GetResourceString( "All_ToString" ); } 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(), "System.Security.Policy.AllMembershipCondition" ); // If you hit this assert then most likely you are trying to change the name of this class. // This is ok as long as you change the hard coded string above and change the assert below. BCLDebug.Assert( this.GetType().FullName.Equals( "System.Security.Policy.AllMembershipCondition" ), "Class name changed!" ); 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" ) ); } } public override bool Equals( Object o ) { return (o is AllMembershipCondition); } public override int GetHashCode() { return typeof( AllMembershipCondition ).GetHashCode(); } } } // 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
- IItemContainerGenerator.cs
- ManagementNamedValueCollection.cs
- DoubleKeyFrameCollection.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- MinimizableAttributeTypeConverter.cs
- BindingUtils.cs
- SymbolMethod.cs
- PeerApplication.cs
- FormsAuthenticationUser.cs
- InputEventArgs.cs
- Brush.cs
- ListViewDeletedEventArgs.cs
- TextSyndicationContentKindHelper.cs
- DataGridViewCellValueEventArgs.cs
- InstallerTypeAttribute.cs
- ToolboxItemSnapLineBehavior.cs
- CqlParser.cs
- XmlSchemaType.cs
- GridViewDesigner.cs
- SafeMemoryMappedFileHandle.cs
- ZipIOExtraField.cs
- FormParameter.cs
- AxImporter.cs
- Int32Collection.cs
- BroadcastEventHelper.cs
- SerialErrors.cs
- Transform3D.cs
- sqlmetadatafactory.cs
- StylusPointProperties.cs
- MultiByteCodec.cs
- SqlInternalConnectionTds.cs
- GridPatternIdentifiers.cs
- SafeNativeMethods.cs
- Conditional.cs
- MappedMetaModel.cs
- WhileDesigner.cs
- DataSourceCache.cs
- XmlSchemaValidationException.cs
- ComplexBindingPropertiesAttribute.cs
- Module.cs
- MemoryRecordBuffer.cs
- UnsafeNativeMethods.cs
- BulletDecorator.cs
- CodeDirectiveCollection.cs
- LockingPersistenceProvider.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- XmlDataSourceNodeDescriptor.cs
- RotateTransform3D.cs
- LongValidatorAttribute.cs
- RegexCompiler.cs
- MenuScrollingVisibilityConverter.cs
- Path.cs
- TemplateManager.cs
- ConfigurationPermission.cs
- Evaluator.cs
- FlowLayoutSettings.cs
- SQLBoolean.cs
- PathStreamGeometryContext.cs
- SamlAuthorityBinding.cs
- XmlSchemaSimpleType.cs
- DataControlFieldHeaderCell.cs
- Geometry3D.cs
- HttpRuntimeSection.cs
- COM2IDispatchConverter.cs
- ReadWriteSpinLock.cs
- ipaddressinformationcollection.cs
- DeploymentSection.cs
- UInt32Storage.cs
- DbgUtil.cs
- GeometryGroup.cs
- StylusButton.cs
- Compilation.cs
- XmlSchemaValidationException.cs
- Decoder.cs
- HtmlWindow.cs
- RecoverInstanceLocksCommand.cs
- TransformPattern.cs
- GlobalizationAssembly.cs
- TextRenderer.cs
- MsmqIntegrationBindingElement.cs
- DataGridViewColumnConverter.cs
- PolicyStatement.cs
- wgx_commands.cs
- returneventsaver.cs
- NotifyInputEventArgs.cs
- XmlUtilWriter.cs
- TimerElapsedEvenArgs.cs
- WebPartsPersonalization.cs
- GeometryConverter.cs
- WebPartHelpVerb.cs
- SqlConnectionManager.cs
- XmlSchemaSet.cs
- UnionCqlBlock.cs
- DataTemplateSelector.cs
- SvcFileManager.cs
- SequenceFullException.cs
- datacache.cs
- RequiredAttributeAttribute.cs
- ProtocolElement.cs
- DesignSurfaceManager.cs