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
- FieldToken.cs
- StyleSelector.cs
- FileRegion.cs
- TextDecorations.cs
- RegisteredScript.cs
- PartBasedPackageProperties.cs
- KeyValueInternalCollection.cs
- ToolStripItemEventArgs.cs
- WinFormsUtils.cs
- DbConnectionClosed.cs
- TemplateBindingExpression.cs
- RecordConverter.cs
- SecureEnvironment.cs
- OracleMonthSpan.cs
- HealthMonitoringSection.cs
- DomainUpDown.cs
- NameScope.cs
- AudioFormatConverter.cs
- OleDbErrorCollection.cs
- GridViewCancelEditEventArgs.cs
- WaitHandle.cs
- Int16Converter.cs
- DictionaryTraceRecord.cs
- XDeferredAxisSource.cs
- Geometry3D.cs
- EventArgs.cs
- ActivityPropertyReference.cs
- AnonymousIdentificationModule.cs
- AesManaged.cs
- DeferredRunTextReference.cs
- ClientScriptManagerWrapper.cs
- Hashtable.cs
- WorkflowInlining.cs
- EncoderParameter.cs
- DataSourceNameHandler.cs
- AppDomainFactory.cs
- DocumentReferenceCollection.cs
- ElementAction.cs
- ImageMapEventArgs.cs
- CompressedStack.cs
- PageFunction.cs
- SiteMapDataSource.cs
- PointLight.cs
- RadioButtonList.cs
- Persist.cs
- PieceNameHelper.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- ActiveXSite.cs
- TrackingDataItem.cs
- ReachSerializerAsync.cs
- CodeThrowExceptionStatement.cs
- OracleConnection.cs
- ButtonPopupAdapter.cs
- WbemProvider.cs
- SchemeSettingElementCollection.cs
- SmtpAuthenticationManager.cs
- OutputCacheSettings.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- RemotingService.cs
- NumberFormatInfo.cs
- TypeDescriptionProvider.cs
- Constants.cs
- ResourceDisplayNameAttribute.cs
- X509Utils.cs
- ComplexBindingPropertiesAttribute.cs
- SmtpNegotiateAuthenticationModule.cs
- UserControlBuildProvider.cs
- DataPagerField.cs
- Material.cs
- SqlDataSourceSelectingEventArgs.cs
- ToolStripItemTextRenderEventArgs.cs
- QuaternionRotation3D.cs
- DataTableExtensions.cs
- SoapFormatter.cs
- TimeSpanConverter.cs
- FileUtil.cs
- HttpWebRequest.cs
- Mutex.cs
- GenericEnumConverter.cs
- ScriptResourceHandler.cs
- TabletCollection.cs
- prefixendpointaddressmessagefilter.cs
- ItemCollection.cs
- DbConnectionHelper.cs
- LineBreakRecord.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- ActiveXHelper.cs
- DefaultClaimSet.cs
- EntityViewGenerationConstants.cs
- IdleTimeoutMonitor.cs
- ObjectDataSourceFilteringEventArgs.cs
- securestring.cs
- AttributeSetAction.cs
- SortKey.cs
- XmlCustomFormatter.cs
- FileDetails.cs
- CreateParams.cs
- DataDesignUtil.cs
- WebCategoryAttribute.cs
- BindStream.cs