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
- ZeroOpNode.cs
- RenamedEventArgs.cs
- AssociatedControlConverter.cs
- RtType.cs
- DetailsViewDeleteEventArgs.cs
- WriteableBitmap.cs
- StateDesigner.Helpers.cs
- ObjectDataSourceStatusEventArgs.cs
- LinearGradientBrush.cs
- Error.cs
- CommandField.cs
- SafeRightsManagementHandle.cs
- CodeLinePragma.cs
- Base64Decoder.cs
- BasicCommandTreeVisitor.cs
- ImportCatalogPart.cs
- WinInetCache.cs
- MethodRental.cs
- XMLSyntaxException.cs
- WpfGeneratedKnownProperties.cs
- GetReadStreamResult.cs
- CodeNamespaceCollection.cs
- BmpBitmapEncoder.cs
- AttributeData.cs
- HashHelper.cs
- DataSetSchema.cs
- BufferedStream.cs
- TableItemProviderWrapper.cs
- ComponentChangedEvent.cs
- LazyTextWriterCreator.cs
- SiteMapProvider.cs
- ExtensionDataReader.cs
- AttributeCollection.cs
- Int64.cs
- EntityTypeBase.cs
- XomlDesignerLoader.cs
- StylusPointProperty.cs
- _AutoWebProxyScriptHelper.cs
- RegionInfo.cs
- BamlLocalizationDictionary.cs
- FacetEnabledSchemaElement.cs
- CustomErrorCollection.cs
- ImageAnimator.cs
- OracleBFile.cs
- VariableExpressionConverter.cs
- UserControlDocumentDesigner.cs
- TeredoHelper.cs
- StandardCommands.cs
- SamlDoNotCacheCondition.cs
- BinaryConverter.cs
- GCHandleCookieTable.cs
- GraphicsPath.cs
- EpmContentSerializer.cs
- OleDbCommand.cs
- HttpChannelHelper.cs
- WebPartsPersonalizationAuthorization.cs
- AutoResetEvent.cs
- SqlClientPermission.cs
- SourceFileBuildProvider.cs
- _SingleItemRequestCache.cs
- FormDocumentDesigner.cs
- TypeConverter.cs
- TextInfo.cs
- EmptyArray.cs
- UpdatePanelControlTrigger.cs
- HttpWebResponse.cs
- DoubleKeyFrameCollection.cs
- TableCellCollection.cs
- CodeDelegateCreateExpression.cs
- InstancePersistence.cs
- autovalidator.cs
- ChannelServices.cs
- CodeStatement.cs
- DetailsViewDeleteEventArgs.cs
- DateTimeConstantAttribute.cs
- Int32KeyFrameCollection.cs
- ResourceCategoryAttribute.cs
- AsyncCompletedEventArgs.cs
- NameTable.cs
- SqlTriggerAttribute.cs
- ContactManager.cs
- DbInsertCommandTree.cs
- SoundPlayer.cs
- PropertyChangeTracker.cs
- SafeUserTokenHandle.cs
- CmsInterop.cs
- RequiredAttributeAttribute.cs
- Subtree.cs
- ApplicationInterop.cs
- ZipIOModeEnforcingStream.cs
- ChangeProcessor.cs
- BinaryMethodMessage.cs
- CompModSwitches.cs
- SQLInt32Storage.cs
- OdbcInfoMessageEvent.cs
- Shape.cs
- TypeHelpers.cs
- HostedTcpTransportManager.cs
- TextureBrush.cs
- BamlLocalizerErrorNotifyEventArgs.cs