Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Policy / AllMembershipCondition.cs / 1305376 / 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; using System.Diagnostics.Contracts; [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. Contract.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" ) ); } Contract.EndContractBlock(); } 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
- Bold.cs
- DataTableNewRowEvent.cs
- FixedHighlight.cs
- EmissiveMaterial.cs
- ToolBarButtonClickEvent.cs
- HttpApplicationFactory.cs
- XmlSchemaFacet.cs
- InternalControlCollection.cs
- PointLight.cs
- StickyNoteHelper.cs
- WebPartDescriptionCollection.cs
- SchemaMerger.cs
- SqlNodeAnnotations.cs
- ContextMenu.cs
- ServicePointManager.cs
- FileDialogCustomPlace.cs
- WindowsTab.cs
- InstanceCollisionException.cs
- PropertyPushdownHelper.cs
- ChangeBlockUndoRecord.cs
- DataKeyCollection.cs
- CompositeDuplexBindingElementImporter.cs
- VariableDesigner.xaml.cs
- ListParaClient.cs
- AuditLog.cs
- KeyInterop.cs
- GridViewSortEventArgs.cs
- Reference.cs
- ClientSettingsSection.cs
- TimelineGroup.cs
- SafePEFileHandle.cs
- Fault.cs
- SafeFindHandle.cs
- HtmlInputImage.cs
- SimpleApplicationHost.cs
- BamlBinaryReader.cs
- BaseHashHelper.cs
- TextRangeAdaptor.cs
- RowToParametersTransformer.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- TreeNodeCollection.cs
- WithParamAction.cs
- OleDbConnection.cs
- XXXInfos.cs
- FunctionUpdateCommand.cs
- EllipticalNodeOperations.cs
- AutomationPropertyInfo.cs
- DataGridColumnFloatingHeader.cs
- LicenseContext.cs
- TrustLevelCollection.cs
- TrackingServices.cs
- MobileTextWriter.cs
- ThaiBuddhistCalendar.cs
- DirectoryLocalQuery.cs
- CompilationUtil.cs
- StreamGeometryContext.cs
- GridViewColumn.cs
- HashCoreRequest.cs
- BitmapEffectCollection.cs
- SelectionBorderGlyph.cs
- DataColumnChangeEvent.cs
- ValidationResult.cs
- WindowsListBox.cs
- FigureParaClient.cs
- ToolStripItemCollection.cs
- Setter.cs
- datacache.cs
- DispatcherHooks.cs
- ModelProperty.cs
- CodeAttributeArgument.cs
- UntypedNullExpression.cs
- LinkDescriptor.cs
- EdmFunction.cs
- securitycriticaldataformultiplegetandset.cs
- ValueSerializerAttribute.cs
- HighlightComponent.cs
- CurrentTimeZone.cs
- IndependentAnimationStorage.cs
- CommandEventArgs.cs
- ArcSegment.cs
- StringResourceManager.cs
- LinearKeyFrames.cs
- StreamWriter.cs
- DataConnectionHelper.cs
- SecurityUtils.cs
- MSG.cs
- CombinedGeometry.cs
- ParameterSubsegment.cs
- EntityObject.cs
- ListControlBoundActionList.cs
- WebPartZoneBase.cs
- ErrorStyle.cs
- SafePointer.cs
- StaticExtension.cs
- SafeNativeMethods.cs
- SolidColorBrush.cs
- RegexStringValidator.cs
- URIFormatException.cs
- HyperLinkField.cs
- SelectionProviderWrapper.cs