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
- DocumentPageViewAutomationPeer.cs
- ToolStripSplitStackLayout.cs
- AliasGenerator.cs
- SecurityTraceRecordHelper.cs
- EllipseGeometry.cs
- BitmapImage.cs
- SwitchLevelAttribute.cs
- Interlocked.cs
- MetadataArtifactLoaderFile.cs
- SmiMetaData.cs
- XmlUtil.cs
- CodeAttributeDeclaration.cs
- ColorMatrix.cs
- CriticalFinalizerObject.cs
- MDIClient.cs
- TabletDeviceInfo.cs
- _NestedSingleAsyncResult.cs
- NumberFunctions.cs
- OdbcParameterCollection.cs
- GenericsNotImplementedException.cs
- ClientEventManager.cs
- AssemblyHash.cs
- URL.cs
- Calendar.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- TextMessageEncodingBindingElement.cs
- XamlTypeMapper.cs
- DataTemplateSelector.cs
- HtmlImage.cs
- Dump.cs
- TransferRequestHandler.cs
- DecoderReplacementFallback.cs
- Odbc32.cs
- TrackBarRenderer.cs
- ConfigurationCollectionAttribute.cs
- RowVisual.cs
- UnionExpr.cs
- SchemaDeclBase.cs
- BridgeDataRecord.cs
- DataSpaceManager.cs
- ToolStripPanelRow.cs
- HwndAppCommandInputProvider.cs
- SecureEnvironment.cs
- CounterCreationDataCollection.cs
- DependencyObject.cs
- TreeNodeStyleCollection.cs
- DataSourceCache.cs
- TextUtf8RawTextWriter.cs
- SID.cs
- XmlNotation.cs
- ProcessHost.cs
- x509store.cs
- CodeAccessSecurityEngine.cs
- codemethodreferenceexpression.cs
- StrokeCollectionDefaultValueFactory.cs
- StatusCommandUI.cs
- FieldDescriptor.cs
- KeyboardDevice.cs
- UInt16.cs
- ScriptServiceAttribute.cs
- DataGridViewCheckBoxCell.cs
- XmlTextReaderImpl.cs
- ValueOfAction.cs
- WebPartDisplayModeCancelEventArgs.cs
- TextElementEnumerator.cs
- SQLInt64Storage.cs
- PreloadedPackages.cs
- EncodingDataItem.cs
- ProfileSection.cs
- SiteIdentityPermission.cs
- ToolTipAutomationPeer.cs
- StaticSiteMapProvider.cs
- KerberosReceiverSecurityToken.cs
- SqlAliasesReferenced.cs
- remotingproxy.cs
- securestring.cs
- InstanceDataCollection.cs
- NavigatingCancelEventArgs.cs
- XmlAttributeAttribute.cs
- SubMenuStyle.cs
- FederatedMessageSecurityOverHttp.cs
- WmfPlaceableFileHeader.cs
- CornerRadiusConverter.cs
- UserNameServiceElement.cs
- PrimaryKeyTypeConverter.cs
- COM2TypeInfoProcessor.cs
- XpsFilter.cs
- CopyNamespacesAction.cs
- OpenFileDialog.cs
- PackageRelationshipSelector.cs
- XmlDataLoader.cs
- ParseNumbers.cs
- ToolStripPanelCell.cs
- DataBoundControlAdapter.cs
- CLRBindingWorker.cs
- Validator.cs
- DocumentPageView.cs
- MergeLocalizationDirectives.cs
- TextDecorationCollection.cs
- Expr.cs