예제 #1
0
        public MainWindow(IAppState appState, ISettings settings,
                          IConfigCommsPort commsPort, ICommsPortFactory commsPortFactory)
            : this()
        {
            this.appState         = appState;
            this.settings         = settings;
            this.commsPort        = commsPort;
            this.commsPortFactory = commsPortFactory;

            this.appState.StateChanged += AppState_StateChanged;
            this.appState.State         = NXTCamView.Core.State.NotConnected;
        }
예제 #2
0
        public ColorForm(IAppState appState, IColorTarget colorTarget, IConfigCommsPort commsPort)
        {
            _appState    = appState;
            _commsPort   = commsPort;
            _colorTarget = colorTarget;
            InitializeComponent();
            Icon = AppImages.GetIcon(AppImages.Colors);
            setupColorFunction();
            setupToolbar();
            initErrorImage();
            _appState.StateChanged += appStateChanged;

            StickyWindowsUtil.MakeStickyMDIChild(this);
        }
예제 #3
0
        public TrackingForm(IAppState appState, IConfigCommsPort commsPort)
        {
            _appState = appState;
            InitializeComponent();

            Icon = AppImages.GetIcon(AppImages.Tracking);
            cbtnStart.Command       = new StartTrackingCommand(_appState, this);
            cbtnStop.Command        = new StopTrackingCommand(_appState, this);
            cbtnPause.Command       = new TogglePauseTrackingCommand(_appState, this);
            cbtnPause.ExecutionType = ExecutionType.OnDownUpToggle;

            _appState.StateChanged += appStateStateChanged;

            pnlTrackedColors.MyPaint += pnlTrackedColors_Paint;

            _trackingCmd = new TrackingCommand(_appState, commsPort, objectsDetected);
            SetupColors();

            StickyWindowsUtil.MakeStickyMDIChild(this);
        }
예제 #4
0
        public MainForm(IAppState appState, IUpdater updater, ColorForm colorForm, TrackingForm trackingForm,
                        IConfigCommsPort commsPort, ICommsPortFactory commsPortFactory)
        {
            _appState                 = appState;
            _commsPort                = commsPort;
            _commsPortFactory         = commsPortFactory;
            _updater                  = updater;
            _colorForm                = colorForm;
            _trackingForm             = trackingForm;
            Thread.CurrentThread.Name = "GuiThread";
            Icon = AppImages.GetIcon(AppImages.MainForm);
            InitializeComponent();

            StickyWindowsUtil.MakeSticky(this);
            StickyWindow.Active    = Settings.Default.SnapWindows;
            tsmSnapWindows.Checked = StickyWindow.Active;

            _appState.StateChanged += appStateChanged;
            _appState.State         = State.NotConnected;

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            Application.ThreadException += Application_ThreadException;
        }