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
- COM2IDispatchConverter.cs
- HitTestWithGeometryDrawingContextWalker.cs
- NullRuntimeConfig.cs
- Vector3DAnimationUsingKeyFrames.cs
- SqlMultiplexer.cs
- WebPartConnectionsEventArgs.cs
- ByteKeyFrameCollection.cs
- SHA1CryptoServiceProvider.cs
- ToolStripTemplateNode.cs
- OleDbParameterCollection.cs
- uribuilder.cs
- TimeStampChecker.cs
- DefaultValueConverter.cs
- OdbcUtils.cs
- ValidationHelper.cs
- EdmItemError.cs
- Point3D.cs
- XmlAttributeOverrides.cs
- PropertyEmitterBase.cs
- DesignerTransactionCloseEvent.cs
- ProviderManager.cs
- Label.cs
- CodeMemberMethod.cs
- DesignTimeSiteMapProvider.cs
- ColumnReorderedEventArgs.cs
- TypeSemantics.cs
- SplitterDesigner.cs
- VisualStyleRenderer.cs
- SmtpNetworkElement.cs
- AuthStoreRoleProvider.cs
- CapacityStreamGeometryContext.cs
- ZipArchive.cs
- Socket.cs
- SqlDependency.cs
- DataExchangeServiceBinder.cs
- XPathPatternBuilder.cs
- AuthenticationService.cs
- BinaryConverter.cs
- HtmlTableCell.cs
- DataRelationCollection.cs
- ItemChangedEventArgs.cs
- PatternMatchRules.cs
- ScriptHandlerFactory.cs
- HttpCacheParams.cs
- StorageRoot.cs
- DeclarativeCatalogPart.cs
- CharEntityEncoderFallback.cs
- ResourceProviderFactory.cs
- PkcsUtils.cs
- GPPOINT.cs
- Baml2006ReaderContext.cs
- _NegoStream.cs
- WebServiceMethodData.cs
- PropertyConverter.cs
- LabelEditEvent.cs
- ExpressionDumper.cs
- XmlException.cs
- DemultiplexingClientMessageFormatter.cs
- ProgressBarHighlightConverter.cs
- SaveLedgerEntryRequest.cs
- ModelPropertyImpl.cs
- StorageMappingItemCollection.cs
- Logging.cs
- DomainUpDown.cs
- BreakRecordTable.cs
- SmiRequestExecutor.cs
- MexTcpBindingElement.cs
- ResourcePermissionBaseEntry.cs
- Point3DCollection.cs
- FirstMatchCodeGroup.cs
- LocalizableAttribute.cs
- SchemaInfo.cs
- PagesSection.cs
- TableLayoutPanel.cs
- SQLInt32.cs
- RangeExpression.cs
- MenuBindingsEditor.cs
- WebZoneDesigner.cs
- NullableDecimalMinMaxAggregationOperator.cs
- AutomationElement.cs
- SecurityAppliedMessage.cs
- AttributeSetAction.cs
- ProtocolsConfigurationHandler.cs
- ILGenerator.cs
- RegexTree.cs
- GeneralTransform3DTo2D.cs
- SizeConverter.cs
- XmlWhitespace.cs
- XmlDocument.cs
- MiniLockedBorderGlyph.cs
- BinaryParser.cs
- XmlElementAttributes.cs
- translator.cs
- AppSettingsExpressionBuilder.cs
- PasswordTextNavigator.cs
- TemplateField.cs
- OrCondition.cs
- LongValidatorAttribute.cs
- BitStack.cs
- XmlSchemaAny.cs