public bool Open()
        {
            try
            {
                application = new AgilentPNA835x.ApplicationClass(); //is this object obtained by running the PNAproxy script?
                online      = true;
            }
            catch (Exception e)
            {
                StringBuilder sb = new StringBuilder(e.Message);
                if (e.Data != null)
                {
                    sb.Append("  Extra details:");
                    foreach (DictionaryEntry de in e.Data)
                    {
                        sb.AppendFormat("    Key: {0}, Value: {1}" +
                                        de.Key, de.Value);
                    }
                }
                MessageBox.Show(sb.ToString(), "PNA Exception on Connect");

                return(false);
            }

            online = true;
            return(true);
        }
 public void Close()
 {
     if (online)
     {
         this.application.Quit();
         this.application = null;
         online           = false;
     }
 }