Example #1
0
        public MainWindow()
        {
            notify = new NotifyIcon
            {
                Icon    = DRnamespace.Properties.Resources.notify_norm,
                Visible = true
            };

            InitializeComponent();

            appmani  = new AppManager(false);
            ffmpeg   = new FFmpeg();
            graph    = new Graph((bool)DC_box.IsChecked);
            recorder = new Recorder(appmani, ffmpeg, graph, CaptureButton, RecordButton, notify);

            notify.MouseClick += (s, e) =>
            {
                if (e.Button == MouseButtons.Left)
                {
                    Show();
                    ShowInTaskbar = true;
                    Activate();

                    if (displayer.IsVisible)
                    {
                        displayer.Show();
                        displayer.Activate();
                    }
                }
                else if (e.Button == MouseButtons.Right)
                {
                    if (recorder.Recording())
                    {
                        recorder.StopRecording();
                    }
                    else
                    {
                        recorder.StartRecording();
                    }
                }
            };

            this.Opacity = 0.0;

            recorder.Start();

            UI_thread = new Thread(UIthread);
            UI_thread.Start();

            area_window = new AreaWind();
            displayer   = new Displayer();
        }
Example #2
0
        public MainWindow()
        {
            //Set up the icon first
            notify = new NotifyIcon
            {
                Text    = "DrawingRecorder",
                Icon    = Properties.Resources.notify_norm,
                Visible = true
            };

            //startup initializing
            InitializeComponent();

            //objects needed
            appmani  = new AppManager(false, notify);
            ffmpeg   = new FFmpeg();
            graph    = new Graph((bool)DC_box.IsChecked);
            recorder = new Recorder(appmani, ffmpeg, graph, CaptureButton, RecordButton, notify);
            recorder.Start();

            //windows initializing
            area_window = new AreaWind();
            displayer   = new Displayer();

            //setup the mouseclick event of the icon
            notify.MouseClick += (s, e) =>
            {
                if (e.Button == MouseButtons.Left)
                {
                    Show();
                    ShowInTaskbar = true;
                    Activate();

                    if (displayer.IsVisible)
                    {
                        displayer.Show();
                        displayer.Activate();
                    }
                }
                else if (e.Button == MouseButtons.Right)
                {
                    if (recorder.Recording())
                    {
                        recorder.StopRecording();
                    }
                    else
                    {
                        recorder.StartRecording();
                    }
                }
            };

            //initialize the UI thread and start it
            UI_thread = new Thread(UIthread);
            UI_thread.Start();

            Drag_thread = new Thread(NewDragMove);
            Drag_thread.Start();

            loadSettings();
        }