Пример #1
0
            bool SetResponse(string name)
            {
                // dll must exist, otherwise quit
                if (DllName == "")
                {
                    return(false);
                }
                // response must exist in dll, otherwise quit
                if (!ResponseLoader.GetResponseList(DllName).Contains(name))
                {
                    return(false);
                }
                _resp = name;
                try
                {
                    _response = ResponseLoader.FromDLL(_resp, DllName);
                }
                catch (Exception ex)
                {
                    D(ex.Message + ex.StackTrace);
                }
                bool r = _response.isValid;

                if (r)
                {
                    D("loaded response: " + name);
                }
                else
                {
                    D("invalid response: " + name + " " + _response.FullName);
                }
                return(r);
            }
Пример #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            // response library selection
            OpenFileDialog of = new OpenFileDialog();

            of.CheckPathExists = true;
            of.CheckFileExists = true;
            of.DefaultExt      = ".dll";
            of.Filter          = "Response DLL|*.dll";
            of.Multiselect     = false;
            if (of.ShowDialog() == DialogResult.OK)
            {
                args.DllName = of.FileName;

                UpdateResponses(ResponseLoader.GetResponseList(of.FileName));
            }
        }
Пример #3
0
        private bool loadfile(string path)
        {
            string f       = path;
            bool   success = false;

            if (isResponse(f))
            {
                responsedll = f;
                List <string> l = ResponseLoader.GetResponseList(responsedll);
                if (System.IO.File.Exists(f) && (l.Count > 0))
                {
                    if (!isRecentResLib(f))
                    {
                        reslist.DropDownItems.Add(f);
                    }
                }
                status("Found " + l.Count + " responses.  ");
                _rl = new ResponseList(l);
                _rl.ResponseSelected += new DebugDelegate(loadboxname);
                if (_rl.ShowDialog() != DialogResult.OK)
                {
                    status("no response was selected.");
                }

                success = true;
            }
            else if (isTIK(f))
            {
                if (System.IO.File.Exists(f))
                {
                    if (!isRecentTickfile(f) && SecurityImpl.SecurityFromFileName(f).isValid)
                    {
                        recent.DropDownItems.Add(f);
                    }
                }
                epffiles.Add(f);
                success = loadsim();
            }
            else if (isSkin(f))
            {
                loadskin(f);
            }
            hasprereq();

            return(success);
        }
Пример #4
0
        public Gauntlet()
        {
            TrackEnabled = Util.TrackUsage();
            Program      = PROGRAM;
            InitializeComponent();
            Text += " " + Util.TLVersion();
            debug(Util.TLSIdentity());
            args.GotDebug += new DebugDelegate(args_GotDebug);
            args.ParseArgs(Environment.GetCommandLineArgs());
            FormClosing += new FormClosingEventHandler(Gauntlet_FormClosing);
            debug(RunTracker.CountNewGetPrettyRuns(PROGRAM, Util.PROGRAM));
            bw.WorkerSupportsCancellation = true;
            bw.RunWorkerCompleted        += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
            bw.DoWork += new DoWorkEventHandler(bw_DoWork);
            getsymwork.WorkerSupportsCancellation = true;
            getsymwork.DoWork             += new DoWorkEventHandler(getsymwork_DoWork);
            getsymwork.RunWorkerCompleted += new RunWorkerCompletedEventHandler(getsymwork_RunWorkerCompleted);
            getsymwork.RunWorkerAsync();
            getsymwork.RunWorkerCompleted += new RunWorkerCompletedEventHandler(getsymwork_RunWorkerCompleted);

            if (args.isUnattended)
            {
                ordersincsv.Checked = true;
                if (args.HideWindow)
                {
                    this.ShowInTaskbar = false; this.WindowState = FormWindowState.Minimized;
                }
                //ShowWindow(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle, SW_MINIMIZE);
                bindresponseevents();
                queuebut_Click(null, null);
            }
            else
            {
                status("wait while tickdata is loaded...");
                UpdateResponses(ResponseLoader.GetResponseList(args.DllName));
            }

            _optdecision.Items.Clear();
            _optdecision.Items.AddRange(Optimize.GetDecideable().ToArray());
            if (_optdecision.Items.Count > 0)
            {
                _optdecision.Text = "NetPL";
            }
        }