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
- ServiceMoniker.cs
- DeleteIndexBinder.cs
- SessionViewState.cs
- TextTreeFixupNode.cs
- UIElementHelper.cs
- Helpers.cs
- SafePointer.cs
- ArrayHelper.cs
- CodeTypeReferenceSerializer.cs
- Image.cs
- VarInfo.cs
- CommandManager.cs
- ListParagraph.cs
- MetricEntry.cs
- ColumnCollectionEditor.cs
- ContentHostHelper.cs
- FrugalList.cs
- CodeAccessSecurityEngine.cs
- IndexedGlyphRun.cs
- FullTextState.cs
- PageParser.cs
- PeerUnsafeNativeMethods.cs
- ModelItemDictionary.cs
- ProxyAttribute.cs
- LinqDataSource.cs
- CharUnicodeInfo.cs
- HttpCapabilitiesBase.cs
- EncodingStreamWrapper.cs
- ServiceInstanceProvider.cs
- ListBase.cs
- StreamReader.cs
- ForwardPositionQuery.cs
- ObfuscationAttribute.cs
- CodeCompiler.cs
- XmlSchemaNotation.cs
- RSAPKCS1SignatureFormatter.cs
- UInt64.cs
- DataGrid.cs
- StrongNameUtility.cs
- HexParser.cs
- WeakReadOnlyCollection.cs
- PackageRelationship.cs
- CustomLineCap.cs
- Module.cs
- TextModifier.cs
- BackEase.cs
- LineSegment.cs
- TagPrefixCollection.cs
- EventMappingSettingsCollection.cs
- MatrixTransform.cs
- HttpSessionStateWrapper.cs
- HttpCapabilitiesEvaluator.cs
- Encoding.cs
- dbdatarecord.cs
- SimpleTableProvider.cs
- HashStream.cs
- DataContractAttribute.cs
- WebExceptionStatus.cs
- BreakRecordTable.cs
- XmlSchemaExporter.cs
- Privilege.cs
- PackagePartCollection.cs
- ResolveCriteria11.cs
- MachineKeySection.cs
- Translator.cs
- MessageHeaderT.cs
- ResizingMessageFilter.cs
- SafeReversePInvokeHandle.cs
- ListControl.cs
- ConfigWriter.cs
- SelectingProviderEventArgs.cs
- RequestContext.cs
- CheckBoxBaseAdapter.cs
- HideDisabledControlAdapter.cs
- DataGridViewControlCollection.cs
- Win32Exception.cs
- ExpressionPrefixAttribute.cs
- CompositeScriptReference.cs
- DocumentViewerHelper.cs
- SemaphoreFullException.cs
- TypographyProperties.cs
- DateTimePicker.cs
- MethodToken.cs
- Int32Collection.cs
- WebHeaderCollection.cs
- SecUtil.cs
- GetRecipientRequest.cs
- BitmapEffectCollection.cs
- ToolStripDropDownClosedEventArgs.cs
- SqlUtils.cs
- HwndAppCommandInputProvider.cs
- TriggerCollection.cs
- SystemWebExtensionsSectionGroup.cs
- Sql8ExpressionRewriter.cs
- SequenceQuery.cs
- HtmlInputFile.cs
- ComplexBindingPropertiesAttribute.cs
- TdsEnums.cs
- InitializerFacet.cs
- NavigationPropertyEmitter.cs