Exemplo n.º 1
0
        public MainWindow()
        {
            using (SentrySdk.Init("https://[email protected]/1500124"))
            {
                try
                {
                    Instance = this;

                    InitializeComponent();

                    _helper = ServiceProvider.Get <MainWindowHelper>();

                    _helper.MainViewModel.Init(!App.CmdOptions.NoPersist, !App.CmdOptions.Reset);

                    _helper.HotkeySetup.Setup();

                    _helper.TimerModel.Init();

                    Loaded += (Sender, Args) =>
                    {
                        RepositionWindowIfOutside();

                        ServiceProvider.Get <WebcamPage>().SetupPreview();

                        _helper.HotkeySetup.ShowUnregistered();
                    };

                    if (App.CmdOptions.Tray || _helper.Settings.Tray.MinToTrayOnStartup)
                    {
                        Hide();
                    }

                    Closing += (Sender, Args) =>
                    {
                        //StopServer(server);
                        server.Stop();

                        if (!TryExit())
                        {
                            Args.Cancel = true;
                        }
                    };
                    // _helper.MainViewModel
                    server = new Captura.Server();
                    server.Start();
                }
                catch (System.Exception e)
                {
                    SentrySdk.CaptureException(e);
                }
            }
        }
Exemplo n.º 2
0
        public MainWindow()
        {
            Instance = this;

            InitializeComponent();

            _helper = ServiceProvider.Get <MainWindowHelper>();

            _helper.MainViewModel.Init(!App.CmdOptions.NoPersist, !App.CmdOptions.Reset);

            _helper.HotkeySetup.Setup();

            _helper.TimerModel.Init();

            Loaded += (Sender, Args) =>
            {
                RepositionWindowIfOutside();

                ServiceProvider.Get <WebcamPage>().SetupPreview();

                _helper.HotkeySetup.ShowUnregistered();
            };

            if (App.CmdOptions.Tray || _helper.Settings.Tray.MinToTrayOnStartup)
            {
                Hide();
            }

            Closing += (Sender, Args) =>
            {
                if (!TryExit())
                {
                    Args.Cancel = true;
                }
            };

            // Register to bring this instance to foreground when other instances are launched.
            SingleInstanceManager.StartListening(WakeApp);
        }
Exemplo n.º 3
0
        public MainWindow()
        {
            Instance = this;

            InitializeComponent();

            _helper = ServiceProvider.Get <MainWindowHelper>();

            _helper.MainViewModel.Init(!App.CmdOptions.NoPersist, !App.CmdOptions.Reset);

            _helper.HotkeySetup.Setup();

            _helper.TimerModel.Init();

            Loaded += (Sender, Args) =>
            {
                RepositionWindowIfOutside();

                WebCamWindow.Instance.SetupWebcamPreview();

                _helper.HotkeySetup.ShowUnregistered();
            };

            if (App.CmdOptions.Tray || _helper.Settings.Tray.MinToTrayOnStartup)
            {
                Hide();
            }

            Closing += (Sender, Args) =>
            {
                if (!TryExit())
                {
                    Args.Cancel = true;
                }
            };
        }