using System; using System.Windows.Forms; using Mercury.TD.Client.UI.Modules.Shared.Api; using Mercury.TD.Client.Ota.Api; using Mercury.TD.Client.Ota.Core; using Mercury.TD.Client.Ota.Entities.Api; using TDAPIOLELib; namespace TestType { public partial class ResultScriptViewerControl : UserControl, IResultViewer { ITDConnection4 m_tdc; public ResultScriptViewerControl() { InitializeComponent(); } #region Implementation of IResultViewer public void InitViewer(IConnection connection) { // Use the connection only to get the COM OTA connection reference. // The .NET IConnection is not a public API. It is for internal HP use. // None of its methods or properties are expected to be stable from release // to release. // m_tdc is the COM ITDConnection reference. For more details, see the // HP ALM Open Test Architecture Reference. m_tdc = (ITDConnection4)((connection as ITDConnectedObject).TDConnection); } public void ShowResult(Mercury.TD.Client.Ota.Entities.Api.IRun run) { // Use the run argument only to get the COM OTA IRun reference. // The .NET ITest is not a public API. It is for internal HP use. // None of its methods or properties are expected to be stable from release // to release. // legacyRun is the COM IRun reference. For more details, see the // HP ALM Open Test Architecture Reference. IRun2 legacyRun = (IRun2)((run as ILegacyBaseFieldProvider).LegacyBaseField); m_textBox.Text = "Showing run " + legacyRun.Name + " in project " + m_tdc.ProjectName; } #endregion } }