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
- IList.cs
- StylusTip.cs
- AuthorizationRuleCollection.cs
- GACMembershipCondition.cs
- QualificationDataItem.cs
- CheckedListBox.cs
- ErrorRuntimeConfig.cs
- ReadOnlyActivityGlyph.cs
- TableItemProviderWrapper.cs
- UniformGrid.cs
- SHA384.cs
- SchemaImporter.cs
- VisualStyleInformation.cs
- MsmqDiagnostics.cs
- _NetworkingPerfCounters.cs
- DirectoryObjectSecurity.cs
- XPathChildIterator.cs
- Size.cs
- CfgParser.cs
- InvalidDocumentContentsException.cs
- HiddenField.cs
- TokenBasedSetEnumerator.cs
- ClientEventManager.cs
- XmlSchemaAny.cs
- VisualTreeUtils.cs
- CqlBlock.cs
- compensatingcollection.cs
- CompilationUtil.cs
- XmlAttributes.cs
- TimeoutException.cs
- FrameworkElement.cs
- PropertyEmitter.cs
- QueryStoreStatusRequest.cs
- Decimal.cs
- ThousandthOfEmRealPoints.cs
- SimpleWebHandlerParser.cs
- XmlSiteMapProvider.cs
- CollectionDataContract.cs
- FastEncoderWindow.cs
- ButtonChrome.cs
- DbConnectionFactory.cs
- RuleSettingsCollection.cs
- PageThemeCodeDomTreeGenerator.cs
- Queue.cs
- VisualTreeUtils.cs
- PersonalizationProvider.cs
- MenuItemStyleCollection.cs
- PassportAuthentication.cs
- MemberRelationshipService.cs
- OracleTransaction.cs
- RadioButtonBaseAdapter.cs
- SingleObjectCollection.cs
- DataRowComparer.cs
- ViewLoader.cs
- AliasedExpr.cs
- SiteMapProvider.cs
- EntityCommandDefinition.cs
- UIInitializationException.cs
- DataListDesigner.cs
- ToolStripOverflow.cs
- EntityConnection.cs
- SqlFacetAttribute.cs
- HttpModuleAction.cs
- XmlWrappingReader.cs
- LayoutTableCell.cs
- GlobalEventManager.cs
- TypePresenter.xaml.cs
- _UriTypeConverter.cs
- MemberInfoSerializationHolder.cs
- Vars.cs
- ThreadInterruptedException.cs
- TypeBrowser.xaml.cs
- FrugalMap.cs
- ConfigurationElementProperty.cs
- EventProxy.cs
- EmptyEnumerator.cs
- CacheForPrimitiveTypes.cs
- ToolStripDropDownClosingEventArgs.cs
- WebPartUtil.cs
- StrokeCollectionConverter.cs
- DesignerSerializationOptionsAttribute.cs
- Attributes.cs
- StreamGeometry.cs
- APCustomTypeDescriptor.cs
- SafeCloseHandleCritical.cs
- ArgumentFixer.cs
- IfElseDesigner.xaml.cs
- TTSVoice.cs
- ThaiBuddhistCalendar.cs
- IconBitmapDecoder.cs
- CheckBoxPopupAdapter.cs
- ListControl.cs
- DateTimeSerializationSection.cs
- DataBoundControlAdapter.cs
- _SecureChannel.cs
- ResourcePool.cs
- SortExpressionBuilder.cs
- DescendantQuery.cs
- InternalConfigHost.cs
- ProxyWebPartConnectionCollection.cs