Пример #1
0
 private void btnStopHandler_Click(object sender, EventArgs e)
 {
     try
     {
         m_Handler.StopHandler();
         m_Handler = null;
         btnStopHandler.Enabled = false;
         btnStartHandler.Enabled = true;
     }
     catch
     {
     }
 }
Пример #2
0
        private void btnStartHandler_Click(object sender, EventArgs e)
        {
            try
            {
                // you can optionally specify where dependencies can be loaded from
                // if this is blank the system will assume that all dependencies
                // are in the same folder as K2RTDServerKit.dll
                // string binPath = @"C:\kairoot\K2Remote\build\bin";
                // the usual case is to leave this as an empty string
                string binPath = "";
                m_Handler = K2RTDServerKit.Factory.Instance().GetRTDServer(binPath);

                // wire the callbacks for request from Excel and Status changes
                m_Handler.OnRequestHandler += new K2RTDServerKit.OnRequest(OnRequest);
                m_Handler.OnStatusUpdateHandler += new K2RTDServerKit.OnStatusUpdate(OnStatusUpdate);

                // start the Handler
                m_Handler.StartHandler("");

                btnStopHandler.Enabled = true;
                btnStartHandler.Enabled = false;

            }
            catch
            {
            }
        }