Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / clr / src / BCL / System / Security / Policy / AllMembershipCondition.cs / 2 / 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
- SqlProfileProvider.cs
- SiteMap.cs
- RegexStringValidator.cs
- SuppressMessageAttribute.cs
- WebPartManagerDesigner.cs
- Emitter.cs
- CodeVariableDeclarationStatement.cs
- _TransmitFileOverlappedAsyncResult.cs
- OrderPreservingSpoolingTask.cs
- MetaType.cs
- SqlSelectStatement.cs
- SqlProfileProvider.cs
- Int64Animation.cs
- IdentityNotMappedException.cs
- StringStorage.cs
- DataGrid.cs
- QueryOutputWriter.cs
- AnnotationAdorner.cs
- PathFigureCollection.cs
- TypeToken.cs
- LogSwitch.cs
- PriorityQueue.cs
- HyperLinkColumn.cs
- Group.cs
- ToolStripItemImageRenderEventArgs.cs
- HttpModuleCollection.cs
- SecurityPolicySection.cs
- CodeDomConfigurationHandler.cs
- objectresult_tresulttype.cs
- TimelineGroup.cs
- SubstitutionList.cs
- BinaryObjectInfo.cs
- DataServiceRequest.cs
- ObjectAnimationBase.cs
- WebControlParameterProxy.cs
- SystemDiagnosticsSection.cs
- DataServiceKeyAttribute.cs
- DispatcherExceptionEventArgs.cs
- Switch.cs
- EdmPropertyAttribute.cs
- OwnerDrawPropertyBag.cs
- IgnorePropertiesAttribute.cs
- HtmlHead.cs
- HtmlInputFile.cs
- SqlExpressionNullability.cs
- precedingquery.cs
- FloaterBaseParaClient.cs
- ObjectItemConventionAssemblyLoader.cs
- TextServicesCompartment.cs
- SrgsOneOf.cs
- PropertyItemInternal.cs
- ImageClickEventArgs.cs
- Vector.cs
- IxmlLineInfo.cs
- ListBoxItemAutomationPeer.cs
- PointLight.cs
- DurableEnlistmentState.cs
- CollectionBuilder.cs
- OleDbReferenceCollection.cs
- CheckBoxBaseAdapter.cs
- CodeCompiler.cs
- UnhandledExceptionEventArgs.cs
- UserInitiatedNavigationPermission.cs
- NetworkCredential.cs
- SqlDuplicator.cs
- ImageCollectionEditor.cs
- StylusPointCollection.cs
- ImportContext.cs
- FormatException.cs
- NavigationFailedEventArgs.cs
- OleDbSchemaGuid.cs
- DateTimeConstantAttribute.cs
- CalendarDay.cs
- TreePrinter.cs
- XmlUTF8TextWriter.cs
- ManipulationStartedEventArgs.cs
- ContainerParaClient.cs
- Pen.cs
- XamlTemplateSerializer.cs
- PropertyPathConverter.cs
- PrefixQName.cs
- PixelFormats.cs
- Helper.cs
- CommandID.cs
- StringValidator.cs
- OutOfProcStateClientManager.cs
- RefExpr.cs
- BaseDataListComponentEditor.cs
- Rule.cs
- SamlAudienceRestrictionCondition.cs
- SegmentInfo.cs
- HyperLinkField.cs
- ProviderSettingsCollection.cs
- SqlServices.cs
- DynamicMethod.cs
- TreeChangeInfo.cs
- IgnoreFlushAndCloseStream.cs
- SqlConnection.cs
- MethodMessage.cs
- ResourceBinder.cs