using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WebWorks.Help;

namespace WindowsFormsDemoApp
{
  public partial class DemoForm : Form
  {
    private WWHelpAPI mHelp;

    public DemoForm()
    {
      InitializeComponent();

      // Get folder path containing your Help's 'index.html' (entry point file)
      //
      string strExeFilePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
      string strWorkPath = System.IO.Path.GetDirectoryName(strExeFilePath);

      strWorkPath = System.IO.Path.Combine(strWorkPath, @"..\..\..\..\Help");

      Uri myBaseURI = new System.Uri(strWorkPath);

      mHelp = new WWHelpAPI(myBaseURI);
    }

    private void button1_Click(object sender, EventArgs e)
    {
      // Display TopicAlias Topic1 in browser
      //
      mHelp.DisplayHelp("alpha", "Topic1");

      MessageBox.Show("Topic1 should be displayed in browser");
    }

    private void button2_Click(object sender, EventArgs e)
    {
      // Display TopicAlias Topic2 in browser
      //
      mHelp.DisplayHelp("beta", "Topic2");

      MessageBox.Show("Topic2 should be displayed in browser");
    }
  }
}
