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
- XmlDictionaryReaderQuotas.cs
- XmlWriter.cs
- WindowsNonControl.cs
- ChannelDispatcherCollection.cs
- GlyphRun.cs
- UnaryNode.cs
- LoggedException.cs
- AppDomainGrammarProxy.cs
- DataGridRowHeader.cs
- MulticastOption.cs
- safelink.cs
- UiaCoreApi.cs
- QualificationDataAttribute.cs
- NavigationWindowAutomationPeer.cs
- smtpconnection.cs
- RequestNavigateEventArgs.cs
- StringAttributeCollection.cs
- ResourceAssociationSet.cs
- SystemFonts.cs
- MexNamedPipeBindingCollectionElement.cs
- HTMLTagNameToTypeMapper.cs
- UpdateTranslator.cs
- IDQuery.cs
- COM2EnumConverter.cs
- tabpagecollectioneditor.cs
- ModelPerspective.cs
- HttpModuleActionCollection.cs
- _NetRes.cs
- WindowsSpinner.cs
- AssociationTypeEmitter.cs
- AnnotationComponentManager.cs
- PropertyDescriptorGridEntry.cs
- DataGridViewCheckBoxCell.cs
- CodeAccessSecurityEngine.cs
- TextEndOfSegment.cs
- BinaryObjectReader.cs
- XmlDataCollection.cs
- DbgUtil.cs
- LabelAutomationPeer.cs
- ObjectRef.cs
- InfiniteTimeSpanConverter.cs
- CellTreeNodeVisitors.cs
- PropertyInformation.cs
- SqlMetaData.cs
- CodeExpressionRuleDeclaration.cs
- CodeVariableReferenceExpression.cs
- WebBrowserNavigatingEventHandler.cs
- TrimSurroundingWhitespaceAttribute.cs
- SqlClientPermission.cs
- TextRangeEditLists.cs
- RectConverter.cs
- DispatcherBuilder.cs
- Transform3D.cs
- SoapEnumAttribute.cs
- WeakEventTable.cs
- SerialReceived.cs
- RectangleGeometry.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- WebBrowserNavigatedEventHandler.cs
- ColorEditor.cs
- ExpressionReplacer.cs
- SqlProvider.cs
- TextRange.cs
- KnowledgeBase.cs
- EmptyReadOnlyDictionaryInternal.cs
- IMembershipProvider.cs
- ParseChildrenAsPropertiesAttribute.cs
- TableLayoutStyleCollection.cs
- LogWriteRestartAreaState.cs
- FileSystemEventArgs.cs
- Tablet.cs
- HtmlCalendarAdapter.cs
- DataStreamFromComStream.cs
- Effect.cs
- XmlSignificantWhitespace.cs
- AnnotationResource.cs
- BamlLocalizableResource.cs
- Material.cs
- FixedSOMTableCell.cs
- MethodRental.cs
- PostBackOptions.cs
- GroupBox.cs
- FormParameter.cs
- EllipticalNodeOperations.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- WindowsTooltip.cs
- BeginEvent.cs
- DataBinder.cs
- TypeSystemHelpers.cs
- WaitHandleCannotBeOpenedException.cs
- followingsibling.cs
- GridEntryCollection.cs
- DataGridCellInfo.cs
- ScriptManager.cs
- SqlVisitor.cs
- ThreadExceptionDialog.cs
- NullableLongAverageAggregationOperator.cs
- KernelTypeValidation.cs
- RowCache.cs
- DiscoveryMessageSequenceCD1.cs