Code:
/ 4.0 / 4.0 / 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. // ==++== // // 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
- SmtpDigestAuthenticationModule.cs
- ListCardsInFileRequest.cs
- ComplexBindingPropertiesAttribute.cs
- EncodingTable.cs
- TransactionWaitAsyncResult.cs
- CodeTypeParameter.cs
- HtmlLink.cs
- PtsHelper.cs
- DataGridCellInfo.cs
- InvokeBase.cs
- SmiEventSink_Default.cs
- TdsParameterSetter.cs
- AdornerDecorator.cs
- Encoding.cs
- SendSecurityHeaderElement.cs
- XmlSchemaException.cs
- XPathParser.cs
- SqlCommandSet.cs
- StrongName.cs
- ProviderIncompatibleException.cs
- SafeRightsManagementPubHandle.cs
- GcHandle.cs
- PersonalizationState.cs
- StylusLogic.cs
- QilPatternVisitor.cs
- ProfilePropertySettingsCollection.cs
- CompositeCollection.cs
- DataSourceControlBuilder.cs
- AssemblyCache.cs
- AssemblyAssociatedContentFileAttribute.cs
- SqlDataSource.cs
- FilteredDataSetHelper.cs
- DynamicFilter.cs
- MetadataPropertyAttribute.cs
- HostExecutionContextManager.cs
- RegexStringValidator.cs
- MissingSatelliteAssemblyException.cs
- FontFamilyConverter.cs
- ToolTip.cs
- SqlConnectionStringBuilder.cs
- ExtractorMetadata.cs
- CompressStream.cs
- XPathNode.cs
- WeakReferenceEnumerator.cs
- TextServicesManager.cs
- WebHttpSecurity.cs
- FunctionNode.cs
- SimpleType.cs
- EventWaitHandleSecurity.cs
- NullEntityWrapper.cs
- SatelliteContractVersionAttribute.cs
- DataSetMappper.cs
- String.cs
- Stackframe.cs
- TransformerTypeCollection.cs
- DocumentCollection.cs
- XmlReflectionImporter.cs
- TextServicesManager.cs
- ClientRuntime.cs
- Globals.cs
- MetadataPropertyAttribute.cs
- WebPartConnectionsEventArgs.cs
- ActivityInstanceReference.cs
- CustomAssemblyResolver.cs
- ObjectConverter.cs
- BrowserTree.cs
- QualifierSet.cs
- ManagementObjectSearcher.cs
- FixedTextBuilder.cs
- Debug.cs
- PatternMatcher.cs
- ProxyGenerationError.cs
- PingOptions.cs
- CategoryGridEntry.cs
- XslNumber.cs
- ParserOptions.cs
- WebException.cs
- WaitHandleCannotBeOpenedException.cs
- SecUtil.cs
- Int16Animation.cs
- StylusLogic.cs
- InheritanceRules.cs
- ToRequest.cs
- WebPartMovingEventArgs.cs
- XmlWellformedWriter.cs
- ResourceDictionary.cs
- IFormattable.cs
- FillBehavior.cs
- IConvertible.cs
- DataControlFieldCollection.cs
- AccessDataSourceView.cs
- Transform.cs
- SqlProviderManifest.cs
- WebPartExportVerb.cs
- EncodingTable.cs
- ListViewItemMouseHoverEvent.cs
- basevalidator.cs
- FacetChecker.cs
- ReadOnlyKeyedCollection.cs
- MediaPlayer.cs