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
- MD5.cs
- XhtmlBasicObjectListAdapter.cs
- BamlReader.cs
- EncryptedData.cs
- DispatcherHookEventArgs.cs
- CornerRadiusConverter.cs
- ListViewItemCollectionEditor.cs
- AxHost.cs
- ColorConvertedBitmapExtension.cs
- JapaneseLunisolarCalendar.cs
- TextAction.cs
- GeneralTransform.cs
- ImageAttributes.cs
- CollaborationHelperFunctions.cs
- DrawingGroup.cs
- ConfigXmlCDataSection.cs
- DashStyle.cs
- StreamGeometryContext.cs
- TraceXPathNavigator.cs
- NameScopePropertyAttribute.cs
- Odbc32.cs
- DesignObjectWrapper.cs
- BypassElement.cs
- GcHandle.cs
- OciLobLocator.cs
- XPathNavigator.cs
- ApplicationId.cs
- XPathNodeHelper.cs
- ResourceExpressionBuilder.cs
- DbModificationCommandTree.cs
- OrCondition.cs
- ToolStripContentPanel.cs
- PopupControlService.cs
- ResXFileRef.cs
- TextLineBreak.cs
- PeerTransportListenAddressConverter.cs
- MatrixTransform.cs
- HwndHostAutomationPeer.cs
- PaperSource.cs
- MouseActionValueSerializer.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- StopStoryboard.cs
- SqlDataAdapter.cs
- WindowsComboBox.cs
- TableLayoutStyleCollection.cs
- CubicEase.cs
- EntityDataSourceColumn.cs
- XPathPatternParser.cs
- ExpandCollapsePattern.cs
- FolderNameEditor.cs
- CoTaskMemHandle.cs
- _RequestCacheProtocol.cs
- ContainerParaClient.cs
- ProcessModelInfo.cs
- XmlSchemaInferenceException.cs
- ISAPIApplicationHost.cs
- ReachIDocumentPaginatorSerializer.cs
- IntegerValidatorAttribute.cs
- GlyphRun.cs
- RecipientServiceModelSecurityTokenRequirement.cs
- HttpServerVarsCollection.cs
- DocumentPageViewAutomationPeer.cs
- ValueProviderWrapper.cs
- Link.cs
- TypeNameHelper.cs
- ArrayTypeMismatchException.cs
- SqlTrackingService.cs
- SiteMapNodeItem.cs
- SQLResource.cs
- TemplateColumn.cs
- PerformanceCounterCategory.cs
- RadioButtonDesigner.cs
- DataSetMappper.cs
- PersianCalendar.cs
- StandardToolWindows.cs
- StoreUtilities.cs
- CodeSnippetStatement.cs
- Sequence.cs
- ReadOnlyDataSourceView.cs
- DataFieldCollectionEditor.cs
- LoginName.cs
- DataSourceExpression.cs
- Control.cs
- NavigatorInvalidBodyAccessException.cs
- DataTableMappingCollection.cs
- StreamAsIStream.cs
- MessageAction.cs
- TextPatternIdentifiers.cs
- ErrorEventArgs.cs
- Matrix3DValueSerializer.cs
- TraceLevelStore.cs
- FixUp.cs
- ToolStripItemRenderEventArgs.cs
- CalendarItem.cs
- TreeViewEvent.cs
- ActivationServices.cs
- Grid.cs
- CacheVirtualItemsEvent.cs
- DataSourceProvider.cs
- ViewManager.cs