Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Policy / ApplicationDirectory.cs / 1305376 / ApplicationDirectory.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // ApplicationDirectory.cs // //[....] // // ApplicationDirectory is an evidence type representing the directory the assembly // was loaded from. // namespace System.Security.Policy { using System; using System.IO; using System.Security.Util; using System.Collections; using System.Diagnostics.Contracts; [Serializable] [System.Runtime.InteropServices.ComVisible(true)] public sealed class ApplicationDirectory : EvidenceBase { private URLString m_appDirectory; public ApplicationDirectory( String name ) { if (name == null) throw new ArgumentNullException( "name" ); Contract.EndContractBlock(); m_appDirectory = new URLString( name ); } private ApplicationDirectory(URLString appDirectory) { Contract.Assert(appDirectory != null); m_appDirectory = appDirectory; } public String Directory { get { return m_appDirectory.ToString(); } } public override bool Equals(Object o) { ApplicationDirectory other = o as ApplicationDirectory; if (other == null) { return false; } return m_appDirectory.Equals(other.m_appDirectory); } public override int GetHashCode() { return this.m_appDirectory.GetHashCode(); } public override EvidenceBase Clone() { return new ApplicationDirectory(m_appDirectory); } public Object Copy() { return Clone(); } internal SecurityElement ToXml() { SecurityElement root = new SecurityElement( "System.Security.Policy.ApplicationDirectory" ); // 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.ApplicationDirectory" ), "Class name changed!" ); root.AddAttribute( "version", "1" ); if (m_appDirectory != null) root.AddChild( new SecurityElement( "Directory", m_appDirectory.ToString() ) ); return root; } public override String ToString() { return ToXml().ToString(); } } } // 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
- DataObjectCopyingEventArgs.cs
- XmlName.cs
- DbCommandTree.cs
- FrugalMap.cs
- DataGridTable.cs
- VisualProxy.cs
- ImageMap.cs
- GAC.cs
- MergeExecutor.cs
- RectAnimationUsingKeyFrames.cs
- ProcessingInstructionAction.cs
- InheritanceAttribute.cs
- RuntimeArgumentHandle.cs
- StylusSystemGestureEventArgs.cs
- VariableQuery.cs
- WorkflowMarkupSerializationManager.cs
- Size.cs
- ToolboxItemCollection.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- DataGridViewElement.cs
- Win32Exception.cs
- ActivationService.cs
- Transactions.cs
- UInt16Storage.cs
- FilterException.cs
- InkPresenterAutomationPeer.cs
- DataTableCollection.cs
- WebBaseEventKeyComparer.cs
- MessageBox.cs
- EntityDataSourceReferenceGroup.cs
- SqlMetaData.cs
- SerializationObjectManager.cs
- WindowInteropHelper.cs
- DataTableMapping.cs
- DiscoveryClientProtocol.cs
- StringCollection.cs
- BaseTemplateParser.cs
- HtmlShimManager.cs
- WindowsGraphicsWrapper.cs
- ComponentGuaranteesAttribute.cs
- WebPart.cs
- SerializationObjectManager.cs
- XmlSchemaSimpleTypeUnion.cs
- Geometry3D.cs
- SynchronizedInputHelper.cs
- XPathMultyIterator.cs
- ActivityUtilities.cs
- OperatorExpressions.cs
- TextProperties.cs
- SafeProcessHandle.cs
- ProxyElement.cs
- ObjectDataSourceStatusEventArgs.cs
- StylusEventArgs.cs
- TwoPhaseCommit.cs
- RequiredFieldValidator.cs
- DetailsViewInsertEventArgs.cs
- NameTable.cs
- StringInfo.cs
- SingleSelectRootGridEntry.cs
- WorkflowMarkupSerializationManager.cs
- ProtectedConfigurationSection.cs
- NoPersistProperty.cs
- ShaderRenderModeValidation.cs
- ConfigurationSettings.cs
- BaseComponentEditor.cs
- DocumentAutomationPeer.cs
- AutomationPropertyInfo.cs
- ChildDocumentBlock.cs
- TrackingRecord.cs
- DbConnectionOptions.cs
- HotCommands.cs
- HtmlGenericControl.cs
- SchemaHelper.cs
- ZipIOCentralDirectoryBlock.cs
- HostedElements.cs
- FieldToken.cs
- DrawingCollection.cs
- DetailsViewCommandEventArgs.cs
- ParameterCollection.cs
- QueryCacheManager.cs
- XDRSchema.cs
- QilName.cs
- Variant.cs
- OdbcParameterCollection.cs
- BlurEffect.cs
- DNS.cs
- WorkflowItemPresenter.cs
- PlatformCulture.cs
- DESCryptoServiceProvider.cs
- HostAdapter.cs
- Button.cs
- TextDecoration.cs
- WebPartConnectionsCancelVerb.cs
- HeaderedContentControl.cs
- DesignerForm.cs
- SymmetricKeyWrap.cs
- GridViewColumnHeaderAutomationPeer.cs
- ObjectHandle.cs
- _UriTypeConverter.cs
- RemoteArgument.cs