Ejemplo n.º 1
0
        public static string EnterText(string text)
        {
            var wnd = new FixWindow();
            wnd.Text.Text = text;
            wnd.ShowDialog();
            if (wnd.DialogResult.HasValue && wnd.DialogResult.Value) return wnd.Text.Text;
            return text;

        }
Ejemplo n.º 2
0
        public static string EnterText(string text)
        {
            var wnd = new FixWindow();

            wnd.Text.Text = text;
            wnd.ShowDialog();
            if (wnd.DialogResult.HasValue && wnd.DialogResult.Value)
            {
                return(wnd.Text.Text);
            }
            return(text);
        }
Ejemplo n.º 3
0
        void MainWindow_Initialized(object sender, EventArgs e)
        {
            model = (EditorModel)DataContext;
            model.WindowState.PropertyChanged += WindowState_PropertyChanged;

            FaceVideo.Source = new Uri(model.Locations.FaceVideo.FullName);
            ScreenVideo.Source = new Uri(model.Locations.DesktopVideo.FullName);
            FaceVideo.LoadedBehavior = MediaState.Manual;
            ScreenVideo.LoadedBehavior = MediaState.Manual;
            ScreenVideo.Volume = 0;

            ModeChanged();
            PositionChanged();
            PausedChanged();
            RatioChanged();
            videoAvailable = model.Locations.FaceVideo.Exists;

            DispatcherTimer timer = new DispatcherTimer();
            timer.Interval = TimeSpan.FromMilliseconds(timerInterval);
            timer.Tick += (s, a) => { CheckPlayTime(); };
            timer.Start();

            PreviewKeyDown += MainWindow_KeyDown;
            ModelView.MouseDown += Timeline_MouseDown;
            Slider.MouseDown += Timeline_MouseDown;

            Save.Click += (s, a) =>
            {
                model.Save();
            };

            Montage.Click += (s, a) =>
                {
                    model.Save();
                    RunProcess(Services.Montager,model.VideoFolder);
                };

            Assembly.Click += (s, a) =>
                {
                    model.Save();
                    RunProcess(Services.Assembler, model.VideoFolder);
                };

            RepairFace.Click += (s, a) =>
                {
                    model.Save();
                    IsEnabled = false;
                    new Tuto.TutoServices.RepairService().DoWork(model.Locations.FaceVideo,true);
                    IsEnabled = true;
                };

            RepairDesktop.Click += (s, a) =>
            {
                model.Save();
                IsEnabled = false;
                new Tuto.TutoServices.RepairService().DoWork(model.Locations.DesktopVideo,false);
                IsEnabled = true;
            };

            Help.Click += (s, a) =>
                {
                    var data = HelpCreator.CreateModeHelp();
                    var wnd = new HelpWindow();
                    wnd.DataContext = data;
                    wnd.Show();
                };

            GoTo.Click += (s, a) =>
                {
                    var wnd = new FixWindow();
                    wnd.Title = "Enter time";
                    var result = wnd.ShowDialog();
                    if (!result.HasValue || !result.Value) return;
                    var parts = wnd.Text.Text.Split(',', '.', '-', ' ');
                    int time = 0;
                    try
                    {
                        time = int.Parse(parts[0]) * 60 + int.Parse(parts[1]);
                    }
                    catch
                    {
                        MessageBox.Show("Incorrect string. Expected format is '5-14'");
                        return;
                    }
                    time *= 1000;
                    int current = 0;
                    foreach (var z in model.Montage.Chunks)
                    {
                        if (z.IsNotActive) time += z.Length;
                        current += z.Length;
                        if (current > time) break;
                    }
                    model.WindowState.CurrentPosition = time;
                };

            Synchronize.Click += Synchronize_Click;

            Infos.Click += Infos_Click;
        }