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
- LambdaCompiler.cs
- userdatakeys.cs
- InstanceLockQueryResult.cs
- ImportDesigner.xaml.cs
- RadioButtonList.cs
- Wildcard.cs
- ErrorTableItemStyle.cs
- Pool.cs
- _FtpControlStream.cs
- SessionStateUtil.cs
- FontStyle.cs
- WindowProviderWrapper.cs
- ToolStripComboBox.cs
- ModelUIElement3D.cs
- AdapterSwitches.cs
- DataRelationPropertyDescriptor.cs
- DelayDesigner.cs
- ForwardPositionQuery.cs
- LedgerEntryCollection.cs
- OutputCacheModule.cs
- StringAttributeCollection.cs
- ListItemCollection.cs
- LineGeometry.cs
- HttpChannelBindingToken.cs
- CookielessHelper.cs
- StackSpiller.Temps.cs
- CodeVariableDeclarationStatement.cs
- ListSortDescription.cs
- SendAgentStatusRequest.cs
- ConfigXmlSignificantWhitespace.cs
- LightweightCodeGenerator.cs
- EntityDataSourceUtil.cs
- BindingNavigatorDesigner.cs
- ServiceOperationParameter.cs
- CurrencyManager.cs
- ExtenderHelpers.cs
- RegexWorker.cs
- Rotation3D.cs
- DynamicValidatorEventArgs.cs
- TemplateApplicationHelper.cs
- DbConnectionFactory.cs
- ExpandCollapseIsCheckedConverter.cs
- CodeDomDesignerLoader.cs
- SecureConversationServiceCredential.cs
- SmiRequestExecutor.cs
- StandardCommandToolStripMenuItem.cs
- PropertyGridEditorPart.cs
- ThicknessAnimationUsingKeyFrames.cs
- CreateUserWizard.cs
- ReversePositionQuery.cs
- DataServiceBuildProvider.cs
- PersonalizationStateQuery.cs
- ServiceModelConfiguration.cs
- EventHandlers.cs
- CalendarDesigner.cs
- DataRecordInternal.cs
- ContextStaticAttribute.cs
- ConstraintEnumerator.cs
- WebRequest.cs
- Popup.cs
- SendActivityDesignerTheme.cs
- KeyedHashAlgorithm.cs
- ConfigurationHandlersInstallComponent.cs
- RegisteredScript.cs
- Win32SafeHandles.cs
- EntityChangedParams.cs
- HttpRequest.cs
- WebPartDeleteVerb.cs
- EventBuilder.cs
- HighContrastHelper.cs
- NodeInfo.cs
- HtmlButton.cs
- PopupControlService.cs
- LoginView.cs
- VerticalAlignConverter.cs
- ListBoxAutomationPeer.cs
- CaseKeyBox.ViewModel.cs
- HtmlTableRowCollection.cs
- TypedReference.cs
- ProviderBase.cs
- NullableFloatAverageAggregationOperator.cs
- Rectangle.cs
- FormsAuthenticationConfiguration.cs
- CodeMemberEvent.cs
- MessagePropertyFilter.cs
- relpropertyhelper.cs
- XmlSchemaSimpleTypeList.cs
- WindowsScrollBarBits.cs
- GridViewUpdatedEventArgs.cs
- NumericExpr.cs
- PathFigureCollection.cs
- OpCopier.cs
- DictionaryContent.cs
- NameObjectCollectionBase.cs
- TypefaceMap.cs
- MultiView.cs
- BinaryKeyIdentifierClause.cs
- StrongNameIdentityPermission.cs
- IPPacketInformation.cs
- XslException.cs