Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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 assertt 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 assertt 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CompiledXpathExpr.cs
- NumberFormatInfo.cs
- ConfigurationSettings.cs
- HitTestDrawingContextWalker.cs
- DataKeyCollection.cs
- RequestBringIntoViewEventArgs.cs
- MetadataPropertyvalue.cs
- Point.cs
- ColorMap.cs
- DataGridCellInfo.cs
- CanonicalXml.cs
- XmlNodeComparer.cs
- FileVersion.cs
- StrokeCollectionDefaultValueFactory.cs
- DLinqDataModelProvider.cs
- SlipBehavior.cs
- BindingListCollectionView.cs
- WebPartsSection.cs
- DataFieldEditor.cs
- InternalUserCancelledException.cs
- GeometryCollection.cs
- GeneralTransform3DTo2D.cs
- SecurityManager.cs
- NameValuePair.cs
- WebColorConverter.cs
- HebrewCalendar.cs
- WindowsPrincipal.cs
- XmlFileEditor.cs
- DynamicQueryableWrapper.cs
- DataGridCellsPresenter.cs
- ByteConverter.cs
- WebServiceClientProxyGenerator.cs
- ChannelBase.cs
- VersionedStream.cs
- BooleanFunctions.cs
- Bits.cs
- MDIClient.cs
- GenericWebPart.cs
- TypedTableBase.cs
- DesignBindingPropertyDescriptor.cs
- HandlerMappingMemo.cs
- MSAAEventDispatcher.cs
- ParserContext.cs
- ComplusEndpointConfigContainer.cs
- ActivityInterfaces.cs
- InputChannelAcceptor.cs
- SqlInternalConnectionTds.cs
- XmlNotation.cs
- AssemblyCollection.cs
- DiffuseMaterial.cs
- TraceContext.cs
- PeerToPeerException.cs
- PropertyItem.cs
- FloaterBaseParaClient.cs
- InlineUIContainer.cs
- DataColumnPropertyDescriptor.cs
- Rijndael.cs
- DefaultCommandExtensionCallback.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- LOSFormatter.cs
- CodeDOMUtility.cs
- SemanticBasicElement.cs
- ListViewDataItem.cs
- DesignTimeVisibleAttribute.cs
- PeekCompletedEventArgs.cs
- DataGridAddNewRow.cs
- Clock.cs
- SqlCacheDependency.cs
- VariableQuery.cs
- X509Certificate2Collection.cs
- XmlSchemaAttributeGroup.cs
- Single.cs
- DnsPermission.cs
- PageCache.cs
- SafeArrayRankMismatchException.cs
- SplitterCancelEvent.cs
- RequestCachePolicy.cs
- listitem.cs
- WindowHelperService.cs
- XsltContext.cs
- QueryContinueDragEvent.cs
- URIFormatException.cs
- ActivityExecutorDelegateInfo.cs
- XmlSchemaAnyAttribute.cs
- ResumeStoryboard.cs
- ConfigurationElement.cs
- DecimalConverter.cs
- EventRoute.cs
- SystemIPInterfaceProperties.cs
- DbConnectionPoolGroupProviderInfo.cs
- DebuggerService.cs
- MdImport.cs
- OrderToken.cs
- ChoiceConverter.cs
- CompatibleComparer.cs
- COM2ExtendedTypeConverter.cs
- NativeMethodsCLR.cs
- SqlLiftIndependentRowExpressions.cs
- SystemDropShadowChrome.cs
- TemplateControlParser.cs