Initializes a new instance of the Link class with the specified name and path.
Namespace:
ESRI.ArcGISExplorer.MappingAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public Link( string name, string path ) |
Visual Basic (Declaration) |
---|
Public Sub New ( _ name As String, _ path As String _ ) |
Parameters
- name
- Type: System..::.String
The name of the new Link; appears in the ArcGIS Explorer contents window when the Link is added to the Map.
- path
- Type: System..::.String
The file path of the target file of the Link; may be any accessible file.
Remarks
This overload of the Link constructor can be used to create a new Link referring to a specified file path. The name parameter is used to set the inherited Name property, and the path parameter is used to set the Path property.
Examples
The code below constructs a path to the Overview class diagram PDF file installed on disk as part of the ArcGIS Explorer SDK
install. Provided the file is found, a Link is created which refers to this file by using the overloaded constructor, and is added to the map.
CopyC#
// Work out the path to the installed Overview class diagram. string pdfPath = Environment.GetEnvironmentVariable("ArcGIS_E3SDK") + @"\Diagrams\OverviewDiagram.pdf"; if (System.IO.File.Exists(pdfPath)) { // Create a new Link to the file. Link overviewPdf = new Link("Overview Class Diagram", pdfPath); // Alternatively, the Name and Path properties can be set after the Link is created. // Add the Link to the Map. ESRI.ArcGISExplorer.Mapping.MapDisplay disp = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay; disp.Map.ChildItems.Add(overviewPdf); }
CopyVB.NET
' Work out the path to the installed Overview class diagram. Dim pdfPath As String = Environment.GetEnvironmentVariable("ArcGIS_E3SDK") & "\Diagrams\OverviewDiagram.pdf" If System.IO.File.Exists(pdfPath) Then ' Create a new Link to the file. Dim overviewPdf As Link = New Link("Overview Class Diagram", pdfPath) ' Alternatively, the Name and Path properties can be set after the Link is created. ' Add the Link to the Map. Dim disp As ESRI.ArcGISExplorer.Mapping.MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay disp.Map.ChildItems.Add(overviewPdf) End If