コード例 #1
0
        void resetresponse(string click)
        {
            if (!isValid)
            {
                // should never happen
                return;
            }
            // confirm
            string extra = isResponseEnabled ? Environment.NewLine + "(Recommend turning off response first, currently ON)" : string.Empty;

            if (System.Windows.Forms.MessageBox.Show("Are you sure you want to reset: " + response.Name + "?" + extra, "Confirm " + response.Name + " Reset", System.Windows.Forms.MessageBoxButtons.YesNoCancel) != System.Windows.Forms.DialogResult.Yes)
            {
                status("User canceled " + response.Name + " reset.");
                return;
            }
            try
            {
                ResponseLoader.SendSimulationHints(ref response, Util.ToTLDate(), Util.ToTLTime(), getallsymbols().ToArray(), debug);
                response.Reset();
                status(response.Name + " was reset by user.");
                debug(response.FullName + " was reset by user.");
            }
            catch (Exception ex)
            {
                status(response.Name + " error during Reset, see debugs.");
                debug(response.FullName + " got an error in user code on Reset, err: " + ex.Message + ex.StackTrace);
            }
        }
コード例 #2
0
 void resetresponse()
 {
     // test if response is valid
     if ((args.Response == null) || !args.Response.isValid)
     {
         return;
     }
     // notify
     debug("Resetting response: " + args.Response.FullName);
     // do work
     try {
         var      r    = args.Response;
         int      date = 0;
         string[] syms = new string[0];
         if (getsimhints(args.Folder, args.Filter, ref date, ref syms))
         {
             ResponseLoader.SendSimulationHints(ref r, date, 0, syms, debug);
         }
         args.Response.Reset();
     }
     catch (Exception ex) { debug("on reset, response threw exception: " + ex.Message); }
 }