chr
2026-04-05 fe750b791d5b517cc4e9bc8e99a9a75139a0cfba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//            Copyright Keysight Technologies 2012-2019
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at http://mozilla.org/MPL/2.0/.
namespace OpenTap
{
    /// <summary>
    /// Custom handler for importing TestPlan data.
    /// Which implementation of ITestPlanImport is used is based on the file type (ITestPlanExport.Extension).
    /// </summary>
    /// <remarks>
    /// The developer determines the content and complexity of classes that implement this type. 
    /// It might be as simple as unzipping a TestPlan, or as complex as reading a well-defined Excel file that represents some TestPlan data.
    /// </remarks>
    [Display("Test Plan Import")]
    public interface ITestPlanImport : ITapPlugin
    {
        /// <summary>
        /// The extension of the imported file including the '.'. For example '.zip'.
        /// </summary>
        string Extension { get; }
 
        /// <summary>
        /// Name of the file format. Shown when the user selects the format in the UI.
        /// For example, Compressed Using Zip.
        /// </summary>
        string Name { get; }
 
        /// <summary>
        /// Imports a file. The contents of the file can be an entire TestPlan, or data to be inserted into a dynamically created TestPlan.  
        /// </summary>
        /// <param name="filePath">The absolute or relative path to file.</param>
        /// <returns>The test plan constructed as part of the Import. </returns>
        TestPlan ImportTestPlan(string filePath);
    }
 
    /// <summary>
    /// Custom handler for exporting TestPlan data.
    /// Which implementation of ITestPlanExport is used is based on the file type (ITestPlanExport.Extension).
    /// </summary>
    /// <remarks>
    /// The developer determines the content and complexity of classes that implement this type/>. 
    /// It might be as simple as unzipping a TestPlan, or as complex as reading a well-defined Excel file that represents some TestPlan data.
    /// </remarks>
    [Display("Test Plan Export")]
    public interface ITestPlanExport : ITapPlugin
    {
        /// <summary>
        /// The extension of the exported file including the '.'. For example '.zip'.
        /// </summary>
        string Extension { get; }
 
        /// <summary>
        /// Name of the file format. Shown when the user selects the format in the GUI.
        /// For example, Compressed Using Zip.
        /// </summary>
        string Name { get; }
 
        /// <summary>
        /// Exports the test plan or TestPlan data to a file. 
        /// </summary>
        /// <param name="plan"> The plan.</param>
        /// <param name="filePath">The absolute or relative path to the file. </param>
        void ExportTestPlan(TestPlan plan, string filePath);
    }
 
    /// <summary>
    /// Custom GUI handler for importing TestPlan data.
    /// </summary>
    /// <remarks>
    /// In contrast to <see cref="ITestPlanImport"/> implementations of this provides their own custom GUI to allows user to select the TestPlan file/data.
    /// For example, using a GUI to load the plan from a database or virtual location such as Dropbox or AWS S3.
    /// </remarks>
    [Display("Test Plan Import Custom Dialog")]
    public interface ITestPlanImportCustomDialog : ITapPlugin
    {
        /// <summary>
        /// Import TestPlan.
        /// </summary>
        /// <returns>The test plan contructed as part of the import</returns>
        TestPlan ImportTestPlan();
    }
 
    /// <summary>
    /// Custom GUI handler for importing TestPlan data.
    /// </summary>
    /// <remarks>
    /// In contrast to <see cref="ITestPlanExport"/> implementations of this provides their own custom GUI to allows user to select the export destination.
    /// For example, using a GUI to save the plan into a database or virtual location such as Dropbox or AWS S3.
    /// </remarks>
    [Display("Test Plan Export Custom Dialog")]
    public interface ITestPlanExportCustomDialog : ITapPlugin
    {
        /// <summary>
        /// Exports the test plan or TestPlan data. 
        /// </summary>
        /// <param name="plan">The plan</param>
        void ExportTestPlan(TestPlan plan);
    }
}