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
- TimeZone.cs
- ServiceModelPerformanceCounters.cs
- Pair.cs
- WindowShowOrOpenTracker.cs
- WindowsAltTab.cs
- HTMLTextWriter.cs
- SqlConnectionHelper.cs
- BaseContextMenu.cs
- DataGridViewCellParsingEventArgs.cs
- ScriptManager.cs
- LifetimeServices.cs
- Style.cs
- HtmlInputSubmit.cs
- DesignTimeXamlWriter.cs
- DiscoveryRequestHandler.cs
- XNodeValidator.cs
- DeferrableContent.cs
- LogManagementAsyncResult.cs
- ToolStripDropDownClosingEventArgs.cs
- EntityContainer.cs
- ControlBuilderAttribute.cs
- ComponentDesigner.cs
- TemplateBamlRecordReader.cs
- WSFederationHttpBindingElement.cs
- PathData.cs
- DataGridViewAutoSizeModeEventArgs.cs
- designeractionbehavior.cs
- AnonymousIdentificationSection.cs
- BorderGapMaskConverter.cs
- ClientBuildManagerCallback.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- CurrencyWrapper.cs
- BitmapEffectDrawing.cs
- UnmanagedMemoryStreamWrapper.cs
- XmlChoiceIdentifierAttribute.cs
- ChannelTraceRecord.cs
- recordstate.cs
- CompiledQueryCacheEntry.cs
- RoutedEventHandlerInfo.cs
- NameValuePermission.cs
- _ScatterGatherBuffers.cs
- SqlBuffer.cs
- IProducerConsumerCollection.cs
- ToolboxItem.cs
- LocatorManager.cs
- TextTreePropertyUndoUnit.cs
- DPCustomTypeDescriptor.cs
- EventPrivateKey.cs
- BamlWriter.cs
- XmlObjectSerializerContext.cs
- XmlExtensionFunction.cs
- RoutedEventConverter.cs
- TagNameToTypeMapper.cs
- ArgumentNullException.cs
- Atom10FormatterFactory.cs
- HttpModulesSection.cs
- CursorConverter.cs
- PropertyNames.cs
- WebPartCatalogCloseVerb.cs
- TypedDatasetGenerator.cs
- StreamedWorkflowDefinitionContext.cs
- ToolBarButton.cs
- unsafenativemethodstextservices.cs
- PageThemeBuildProvider.cs
- Help.cs
- CompilationSection.cs
- XpsLiterals.cs
- SoapReflectionImporter.cs
- SignatureHelper.cs
- StoreItemCollection.cs
- RecognizeCompletedEventArgs.cs
- PropertyEmitter.cs
- GC.cs
- DataGridViewColumnConverter.cs
- ConnectionManagementElement.cs
- Animatable.cs
- PolyLineSegmentFigureLogic.cs
- UnsafeNativeMethods.cs
- AppliedDeviceFiltersDialog.cs
- EllipseGeometry.cs
- StringUtil.cs
- ConfigurationStrings.cs
- AnnotationComponentManager.cs
- x509utils.cs
- FusionWrap.cs
- TableCell.cs
- TextureBrush.cs
- XmlMemberMapping.cs
- ExtendedProtectionPolicyElement.cs
- UrlPropertyAttribute.cs
- BamlLocalizer.cs
- VectorAnimation.cs
- WindowsListViewGroup.cs
- AddInActivator.cs
- PropertyCondition.cs
- MailAddress.cs
- IERequestCache.cs
- TextureBrush.cs
- EntityModelBuildProvider.cs
- DataViewSettingCollection.cs