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
- IPGlobalProperties.cs
- TargetControlTypeAttribute.cs
- LinearKeyFrames.cs
- mediaclock.cs
- MimeMapping.cs
- EncryptedType.cs
- DataGridViewImageCell.cs
- Int16Storage.cs
- PackagePart.cs
- PersonalizationEntry.cs
- DataGridViewColumnTypePicker.cs
- DataGridCellAutomationPeer.cs
- XmlJsonReader.cs
- oledbmetadatacolumnnames.cs
- ItemsPresenter.cs
- ResourceContainerWrapper.cs
- XmlComplianceUtil.cs
- RemoteX509AsymmetricSecurityKey.cs
- TextControlDesigner.cs
- ColumnReorderedEventArgs.cs
- CodeBlockBuilder.cs
- NullableIntAverageAggregationOperator.cs
- FileDataSourceCache.cs
- VectorCollection.cs
- KeysConverter.cs
- LoginCancelEventArgs.cs
- TextElementEnumerator.cs
- ValueChangedEventManager.cs
- mediaeventshelper.cs
- HttpPostServerProtocol.cs
- BuilderPropertyEntry.cs
- IPAddress.cs
- PageSettings.cs
- StylusPointProperties.cs
- _DynamicWinsockMethods.cs
- Vector3DConverter.cs
- TransformerConfigurationWizardBase.cs
- Literal.cs
- XPathAncestorQuery.cs
- ReaderWriterLockWrapper.cs
- Html32TextWriter.cs
- RegexInterpreter.cs
- XamlBrushSerializer.cs
- ProfileGroupSettings.cs
- ApplicationSettingsBase.cs
- HttpListenerRequest.cs
- HttpModulesInstallComponent.cs
- ExpandableObjectConverter.cs
- JsonEncodingStreamWrapper.cs
- DodSequenceMerge.cs
- PageSetupDialog.cs
- ValidationError.cs
- DataComponentGenerator.cs
- DataSourceView.cs
- _TimerThread.cs
- ZipArchive.cs
- HttpCachePolicyWrapper.cs
- MemberInfoSerializationHolder.cs
- ApplicationException.cs
- MSAANativeProvider.cs
- WindowsListViewItemCheckBox.cs
- IDispatchConstantAttribute.cs
- DisplayInformation.cs
- DependencyObject.cs
- EqualityComparer.cs
- Repeater.cs
- RoleManagerSection.cs
- IIS7WorkerRequest.cs
- CategoryGridEntry.cs
- EmptyElement.cs
- LongTypeConverter.cs
- SqlCacheDependencySection.cs
- TreeNodeStyle.cs
- DocumentEventArgs.cs
- DomNameTable.cs
- ArgumentDesigner.xaml.cs
- IpcClientChannel.cs
- MultiBinding.cs
- WebEventTraceProvider.cs
- SurrogateChar.cs
- DataGridViewCellValueEventArgs.cs
- PathSegment.cs
- MetaTableHelper.cs
- IImplicitResourceProvider.cs
- NGCUIElementCollectionSerializerAsync.cs
- ListViewCommandEventArgs.cs
- HttpHandler.cs
- KeyNotFoundException.cs
- FormViewCommandEventArgs.cs
- AspNetHostingPermission.cs
- ExtensionWindowResizeGrip.cs
- MutexSecurity.cs
- StatusBarDrawItemEvent.cs
- MoveSizeWinEventHandler.cs
- RadioButton.cs
- ChtmlPhoneCallAdapter.cs
- JavaScriptObjectDeserializer.cs
- ClusterRegistryConfigurationProvider.cs
- AttributeEmitter.cs
- DrawItemEvent.cs