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
- ViewCellRelation.cs
- SignerInfo.cs
- ControlPropertyNameConverter.cs
- CodeMethodInvokeExpression.cs
- ServerTooBusyException.cs
- KeyConstraint.cs
- ReflectPropertyDescriptor.cs
- OracleDateTime.cs
- MemoryRecordBuffer.cs
- OAVariantLib.cs
- RequestCacheValidator.cs
- RtfToken.cs
- RegexMatchCollection.cs
- HtmlInputImage.cs
- MessageQuerySet.cs
- ItemList.cs
- XmlSerializerSection.cs
- FixedStringLookup.cs
- MulticastIPAddressInformationCollection.cs
- FontWeights.cs
- TypedTableBase.cs
- CharacterShapingProperties.cs
- ImportCatalogPart.cs
- UniqueIdentifierService.cs
- ResourceSetExpression.cs
- GridViewCancelEditEventArgs.cs
- TdsValueSetter.cs
- NavigationFailedEventArgs.cs
- MyContact.cs
- EditorPart.cs
- DetailsView.cs
- VariableQuery.cs
- sqlser.cs
- Property.cs
- MessageQueueTransaction.cs
- HorizontalAlignConverter.cs
- XsltException.cs
- DataContractJsonSerializer.cs
- WindowsStreamSecurityElement.cs
- ProcessModelSection.cs
- KeyBinding.cs
- ChangesetResponse.cs
- FragmentNavigationEventArgs.cs
- ScrollBar.cs
- GetPageNumberCompletedEventArgs.cs
- WebHttpSecurityElement.cs
- X509CertificateClaimSet.cs
- AggregationMinMaxHelpers.cs
- ContractTypeNameCollection.cs
- ChtmlTextBoxAdapter.cs
- Splitter.cs
- EntityDataSource.cs
- ToolboxItemCollection.cs
- ModelUIElement3D.cs
- XmlSchemaGroupRef.cs
- DeferredBinaryDeserializerExtension.cs
- EventDescriptor.cs
- MinMaxParagraphWidth.cs
- WindowsContainer.cs
- nulltextnavigator.cs
- FileStream.cs
- UTF32Encoding.cs
- XmlNavigatorStack.cs
- DataTableReader.cs
- ChineseLunisolarCalendar.cs
- CodeAssignStatement.cs
- DataListGeneralPage.cs
- MobileUserControlDesigner.cs
- PageAdapter.cs
- LocalizationParserHooks.cs
- XPathParser.cs
- ProtocolsConfiguration.cs
- DebugControllerThread.cs
- GridItemCollection.cs
- Visual3DCollection.cs
- SimpleBitVector32.cs
- CFStream.cs
- RecommendedAsConfigurableAttribute.cs
- AnonymousIdentificationSection.cs
- ToolStripDropDownClosingEventArgs.cs
- ColumnHeader.cs
- Page.cs
- FontCacheUtil.cs
- TransformedBitmap.cs
- CategoryNameCollection.cs
- EventManager.cs
- hresults.cs
- TextModifier.cs
- SchemaTableColumn.cs
- SoundPlayerAction.cs
- ViewBox.cs
- CatalogZoneBase.cs
- MarginCollapsingState.cs
- WsdlBuildProvider.cs
- Unit.cs
- VectorAnimation.cs
- Stylesheet.cs
- PageBreakRecord.cs
- BuildProviderCollection.cs
- LinkedList.cs