Code:
/ 4.0 / 4.0 / 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. // ==++== // // 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
- Monitor.cs
- ParameterReplacerVisitor.cs
- StylusOverProperty.cs
- ScrollProviderWrapper.cs
- DiscoveryDocument.cs
- UriScheme.cs
- GACIdentityPermission.cs
- ObjectDataSourceView.cs
- TextPointerBase.cs
- DtrList.cs
- ConstrainedGroup.cs
- BamlLocalizationDictionary.cs
- FilterQuery.cs
- HebrewNumber.cs
- SqlVisitor.cs
- ColorMatrix.cs
- ExpressionNormalizer.cs
- TrustExchangeException.cs
- CodeDOMProvider.cs
- _IPv6Address.cs
- InstanceLockQueryResult.cs
- XmlNodeReader.cs
- BinaryObjectWriter.cs
- Baml2006KeyRecord.cs
- CollectionViewProxy.cs
- DropDownButton.cs
- OleDbParameter.cs
- ToolBar.cs
- FormsAuthenticationModule.cs
- ValuePatternIdentifiers.cs
- MimeFormImporter.cs
- DataGridViewCellCancelEventArgs.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- DataSourceDesigner.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- ProviderCommandInfoUtils.cs
- safelink.cs
- JsonFormatWriterGenerator.cs
- ReliableMessagingHelpers.cs
- ScopelessEnumAttribute.cs
- xmlsaver.cs
- AnimatedTypeHelpers.cs
- GenericPrincipal.cs
- AccessViolationException.cs
- Roles.cs
- StubHelpers.cs
- DynamicMethod.cs
- DesignerObject.cs
- ReflectionHelper.cs
- XmlCharacterData.cs
- SortAction.cs
- Tile.cs
- MasterPageCodeDomTreeGenerator.cs
- WebPartZone.cs
- DataViewManager.cs
- Debug.cs
- ClaimComparer.cs
- _ProxyRegBlob.cs
- ReachVisualSerializer.cs
- InvalidOleVariantTypeException.cs
- Types.cs
- DataGridViewCellParsingEventArgs.cs
- RewritingPass.cs
- CommandField.cs
- ReadOnlyDictionary.cs
- ProviderBase.cs
- ServiceHttpModule.cs
- RadioButtonStandardAdapter.cs
- PreProcessor.cs
- WebPartMovingEventArgs.cs
- IntegerValidatorAttribute.cs
- CheckBoxPopupAdapter.cs
- HideDisabledControlAdapter.cs
- RbTree.cs
- GetCardDetailsRequest.cs
- DoubleLink.cs
- TraceData.cs
- TableLayoutColumnStyleCollection.cs
- HttpHostedTransportConfiguration.cs
- ListItemConverter.cs
- ArgumentDesigner.xaml.cs
- MdiWindowListStrip.cs
- _HTTPDateParse.cs
- XPathSelfQuery.cs
- FrameworkContentElement.cs
- MarkerProperties.cs
- WebPartEditorApplyVerb.cs
- DataServiceQueryOfT.cs
- WebConfigurationFileMap.cs
- x509store.cs
- RuntimeWrappedException.cs
- filewebrequest.cs
- ListViewAutomationPeer.cs
- TableRow.cs
- EventListener.cs
- WindowsAuthenticationModule.cs
- BypassElementCollection.cs
- InvokeProviderWrapper.cs
- ControlAdapter.cs
- HandledEventArgs.cs