Example #1
0
        public MainForm(DecoderJob job, bool startJob)
        {
            InitializeComponent();

            _logBuffer = new List <LogMessage>(100);

            _dispatcher = new JobDispatcher(job);
            _dispatcher.Logger.MessagesChanged += new EventHandler(Log_MessagesChanged);

#if DEBUG
            _dispatcher.Logger.LogLevel = LogLevel.Debug0;
#endif

            _dispatcher.OnJobProgressChanged += new EventHandler(Dispatcher_OnJobProgressChanged);
            _dispatcher.AfterJobCompleted    += new EventHandler(Dispatcher_AfterJobCompleted);

            _autorun = startJob;

            statusBindingSource.DataSource = _dispatcher.Status;

            jobPropertyGrid.SelectedObject = job;
            jobPropertyGrid.ExpandAllGridItems();

            _executionTime  = new TimeSpan();
            _timer          = new Timer();
            _timer.Tick    += new EventHandler(TimerTick);
            _timer.Interval = 1000;

            this.Log_MessagesChanged(this, EventArgs.Empty);
        }
Example #2
0
        public MainForm(DecoderJob job, bool startJob)
        {
            InitializeComponent();

            _logBuffer = new List<LogMessage>(100);

            _dispatcher = new JobDispatcher(job);
            _dispatcher.Logger.MessagesChanged += new EventHandler(Log_MessagesChanged);

            #if DEBUG
            _dispatcher.Logger.LogLevel = LogLevel.Debug0;
            #endif

            _dispatcher.OnJobProgressChanged += new EventHandler(Dispatcher_OnJobProgressChanged);
            _dispatcher.AfterJobCompleted += new EventHandler(Dispatcher_AfterJobCompleted);

            _autorun = startJob;

            statusBindingSource.DataSource = _dispatcher.Status;

            jobPropertyGrid.SelectedObject = job;
            jobPropertyGrid.ExpandAllGridItems();

            _executionTime = new TimeSpan();
            _timer = new Timer();
            _timer.Tick += new EventHandler(TimerTick);
            _timer.Interval = 1000;

            this.Log_MessagesChanged(this, EventArgs.Empty);
        }
Example #3
0
        static int Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            DecoderJob job = null;
            bool startJob = false;
            string cmd = String.Empty;

            if (args.Length > 0)
            {
                switch (args.Length)
                {
                    case 1:
                        cmd = args[0];
                        break;
                    case 2:
                        if (String.Equals(args[0], "/s", StringComparison.CurrentCultureIgnoreCase))
                        {
                            startJob = true;
                            cmd = args[1];
                        }
                        break;
                }

                if (cmd.Length > 0)
                {
                    if (cmd[0] != '/')
                    {
                        job = new DecoderJob();
                        job.SourcePath = cmd;
                        job.DestinationPath = String.Concat(cmd, ".dump");
                    }
                    else if (cmd.Length > 3)
                    {
                        switch (Char.ToLower(cmd[1]))
                        {
                            case 'd':
                                job = new DecoderJob();
                                job.DecodingMode = JobDecodingMode.BatchDecoding;
                                job.SourcePath = cmd.Substring(3);
                                break;
                            case 'j':
                                job = DecoderJob.Load(cmd.Substring(3)) as DecoderJob;
                                break;
                        }
                    }
                }
            }

            MainForm frm = new MainForm((job != null) ? job : new DecoderJob(), startJob);

            AssemblyVersionInfo vInfo = new AssemblyVersionInfo(typeof(DecoderApplication));
            frm.Text = String.Format("{0} {1}.{2} - (build {3})", vInfo.Title, vInfo.Version.Major, vInfo.Version.Minor, vInfo.LastBuildDate.ToString("yyMMdd-HHmm"));

            Application.Run(frm);

            return (int)frm.ResultCode;
        }
Example #4
0
 private void openToolButton_Click(object sender, EventArgs e)
 {
     if (openFileDialog.ShowDialog() == DialogResult.OK)
     {
         _dispatcher.Job = DecoderJob.Load(openFileDialog.FileName) as DecoderJob;
         jobPropertyGrid.SelectedObject = _dispatcher.Job;
     }
 }
Example #5
0
        static int Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            DecoderJob job      = null;
            bool       startJob = false;
            string     cmd      = String.Empty;

            if (args.Length > 0)
            {
                switch (args.Length)
                {
                case 1:
                    cmd = args[0];
                    break;

                case 2:
                    if (String.Equals(args[0], "/s", StringComparison.CurrentCultureIgnoreCase))
                    {
                        startJob = true;
                        cmd      = args[1];
                    }
                    break;
                }

                if (cmd.Length > 0)
                {
                    if (cmd[0] != '/')
                    {
                        job                 = new DecoderJob();
                        job.SourcePath      = cmd;
                        job.DestinationPath = String.Concat(cmd, ".dump");
                    }
                    else if (cmd.Length > 3)
                    {
                        switch (Char.ToLower(cmd[1]))
                        {
                        case 'd':
                            job = new DecoderJob();
                            job.DecodingMode = JobDecodingMode.BatchDecoding;
                            job.SourcePath   = cmd.Substring(3);
                            break;

                        case 'j':
                            job = DecoderJob.Load(cmd.Substring(3)) as DecoderJob;
                            break;
                        }
                    }
                }
            }

            MainForm frm = new MainForm((job != null) ? job : new DecoderJob(), startJob);

            AssemblyVersionInfo vInfo = new AssemblyVersionInfo(typeof(DecoderApplication));

            frm.Text = String.Format("{0} {1}.{2} - (build {3})", vInfo.Title, vInfo.Version.Major, vInfo.Version.Minor, vInfo.LastBuildDate.ToString("yyMMdd-HHmm"));

            Application.Run(frm);

            return((int)frm.ResultCode);
        }