private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            AppPaths.ConfigureFFmpegPaths(this);

            GridInfo.Visibility      = Visibility.Hidden;
            DownloadsView.Visibility = Visibility.Hidden;
            DownloadUrl.Focus();
            DownloadsView.ItemsSource = Manager.DownloadsList;

            List <ListItem <int> > DownloadQualityList = new List <ListItem <int> >();

            DownloadQualityList.Add(new ListItem <int>("Max", 0));
            DownloadQualityList.Add(new ListItem <int>("1080p", 1080));
            DownloadQualityList.Add(new ListItem <int>("720p", 720));
            DownloadQualityList.Add(new ListItem <int>("480p", 480));
            DownloadQualityList.Add(new ListItem <int>("360p", 360));
            DownloadQualityList.Add(new ListItem <int>("240p", 240));
            MaxDownloadQualityCombo.ItemsSource   = DownloadQualityList;
            MaxDownloadQualityCombo.SelectedIndex = 0;

            SplashWindow F = SplashWindow.Instance(this, Properties.Resources.AppIcon);

            F.CanClose();
            F.ShowDialog();
        }
예제 #2
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            Thread t = new Thread(() =>
            {
                SplashWindow sw     = new SplashWindow();
                Dic["SplashWindow"] = sw; //储存
                sw.ShowDialog();          //不能用Show
            });

            t.IsBackground = true;
            t.SetApartmentState(ApartmentState.STA);//设置单线程
            t.Start();

            MainWindow mainWindow = new MainWindow();

            Thread.Sleep(5000);

            if (App.Dic.ContainsKey("SplashWindow"))
            {
                SplashWindow sw = App.Dic["SplashWindow"] as SplashWindow;
                sw.Dispatcher.Invoke((Action)(() => sw.Close()));//在sw的线程上关闭SplashWindow
            }

            mainWindow.Focus();
            mainWindow.Show();
        }
예제 #3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            SplashWindow F = SplashWindow.Instance(this, Properties.Resources.AppIcon);

            F.CanClose();
            F.ShowDialog();
        }
예제 #4
0
 private void toolStripMenuItem1_Click(object sender, EventArgs e)
 {
     sw               = new SplashWindow(true, true, false);
     sw.Topmost       = false;
     sw.ShowInTaskbar = true;
     sw.Title         = "AboutBox";
     sw.ShowDialog();
 }
예제 #5
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // スプラッシュウィンドウの生成
            using (var splash = new SplashWindow(3000))
                splash.ShowDialog();

            Application.Run(new Views.Kisaragi());
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            PlaylistsList.SelectedIndex = 0;
            PlaylistsList.Focus();
            ((ListBoxItem)PlaylistsList.ItemContainerGenerator.ContainerFromIndex(0)).Focus();

            SplashWindow F = SplashWindow.Instance(this, Properties.Resources.AppIcon);

            F.CanClose();
            F.ShowDialog();

            var a = MediaInfo.GetVersion();
        }
예제 #7
0
        public Form1()
        {
            InitializeComponent();

            Thread t = new Thread(() =>
            {
                SplashWindow sw     = new SplashWindow();
                Dic["SplashWindow"] = sw; //储存
                sw.ShowDialog();          //不能用Show
            });

            t.IsBackground = true;
            t.SetApartmentState(ApartmentState.STA);//设置单线程
            t.Start();
        }
예제 #8
0
        protected override void OnStartup(StartupEventArgs e)
        {
            Thread thread = new Thread(() =>
            {
                SplashWindow sw = new SplashWindow();
                // 储存
                Dictionary["SplashWindow"] = sw;
                // 不能用Show
                sw.ShowDialog();
            });

            // 设置单线程
            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();

            base.OnStartup(e);
        }
 public bool StartService()
 {
     bCanceld = false;
     var splash = new SplashWindow();
     if (splash.ShowDialog() == false)
     {
         bCanceld = true;
         return false;
     }
     if (TraceFile.Instance.Start(splash.NameBox.Text, splash.PathBox.Text))
     {
         Error = string.Empty;
         return true;
     }
        Error = TraceFile.Instance.Errormsg;
     return false;
 }
예제 #10
0
        public bool StartService()
        {
            bCanceld = false;
            var splash = new SplashWindow();

            if (splash.ShowDialog() == false)
            {
                bCanceld = true;
                return(false);
            }
            if (TraceFile.Instance.Start(splash.NameBox.Text, splash.PathBox.Text))
            {
                Error = string.Empty;
                return(true);
            }
            Error = TraceFile.Instance.Errormsg;
            return(false);
        }
예제 #11
0
        private async void Main_Loaded(object sender, EventArgs e)
        {
            if (NgMain != null)
            {
                Downloads       = new ViewDownloadsWindow();
                Downloads.Owner = Main;
                Downloads.DownloadsView.ItemsSource = Business.DownloadManager.DownloadsList;
            }

            SplashWindow InitWin = SplashWindow.Instance(Main, SplashImage);

            SplashImage = null;
            // InitWin.Owner = Main;

            CancellationToken token = new CancellationToken();
            Task InitWinTask        = Task.Factory.StartNew(
                () => InitWin.ShowDialog(),
                token,
                TaskCreationOptions.None,
                TaskScheduler.FromCurrentSynchronizationContext());

            await TestDatabaseConnectionAsync();

            if (Settings.SavedFile == null)
            {
                AboutWindow.Instance();
                SettingsWindow.Instance();
            }

            if (NgMain != null)
            {
                await NgMain.InitializationCompleted();
            }

            InitWin.CanClose();
            await InitWinTask;
        }
        public MainWindowViewModel()
        {
            _thumbnails  = new ObservableCollection <ThumbnailViewModel>();
            _activeIdSet = new HashSet <int>();

            _uploadVideoCommand = new RelayCommand(_ =>
            {
                OpenFileDialog dialog = new OpenFileDialog()
                {
                    Filter      = "Videos (*.mp4;*.wmv;*.mov;*.avi)|*.mp4;*.wmv;*.mov;*.avi",
                    Multiselect = false
                };

                bool?ret = dialog.ShowDialog();

                if (!ret.HasValue || !ret.Value)
                {
                    return;
                }

                VideoUrl = dialog.FileName;
            });

            _uploadMetadataCommand = new RelayCommand(_ =>
            {
                OpenFileDialog dialog = new OpenFileDialog()
                {
                    Filter      = "Metadata (*.json)|*.json",
                    Multiselect = false
                };

                bool?ret = dialog.ShowDialog();

                if (!ret.HasValue || !ret.Value)
                {
                    return;
                }

                MetadataUrl = dialog.FileName;
            });

            _uploadThumbnailsCommand = new RelayCommand(_ =>
            {
                OpenFileDialog dialog = new OpenFileDialog()
                {
                    Filter      = "Thumbnails (*.jpg;*.jpeg)|*.jpg;*.jpeg",
                    Multiselect = true
                };

                bool?ret = dialog.ShowDialog();

                if (!ret.HasValue || !ret.Value || dialog.FileNames.Length == 0)
                {
                    return;
                }

                List <string> fileNames = new List <string>()
                {
                    dialog.FileNames[0]
                };
                fileNames.AddRange(dialog.FileNames.Skip(1).Select(f => Path.GetFileName(f)));

                ThumbnailUrls = string.Join("; ", fileNames);
            });

            _nextCommand = new RelayCommand(_ =>
            {
                if (File.Exists(_videoUrl) && File.Exists(_metadataUrl) && _thumbnailUrls.Split(';').Any(File.Exists))
                {
                    BackgroundWorker worker = new BackgroundWorker();
                    worker.DoWork          += LoadData;

                    SplashWindow splash        = new SplashWindow(worker);
                    worker.RunWorkerCompleted += (s, e) =>
                    {
                        foreach (ThumbnailViewModel thumbnail in (e.Result as IEnumerable <ThumbnailViewModel>))
                        {
                            _thumbnails.Add(thumbnail);
                        }
                        ActivePageIndex = 1;
                    };

                    worker.RunWorkerAsync();
                    splash.ShowDialog();
                }
            });

            _backCommand = new RelayCommand(_ =>
            {
                ClearData();
                ActivePageIndex = 0;
            });

            _videoFilters = new IVideoFilter[3];
            ModuleLoader.Load("DEBUG", "Color", System.Drawing.Color.Blue, out _videoFilters[0]);
            _videoFilters[0].SetProvider(this, (int)VideoFilterType.DEBUG_ACTIVE);
            ModuleLoader.Load("DEBUG", "Color", System.Drawing.Color.Yellow, out _videoFilters[1]);
            _videoFilters[1].SetProvider(this, (int)VideoFilterType.DEBUG_INACTIVE);
            ModuleLoader.Load("BLUR", out _videoFilters[2]);
            _videoFilters[2].SetProvider(this, (int)VideoFilterType.BLUR_ACTIVE);
        }
예제 #13
0
        public MainWindow()
        {
            //if (Debugger.IsAttached)
            //    Settings.Default.Reset();

            var splash = new SplashWindow();

            if (splash.ShowDialog().Value)
            {
                InitializeComponent();
                if (Settings.Default.WasMaximized)
                {
                    WindowState = WindowState.Maximized;
                }
                else
                {
                    Width  = Settings.Default.AppWidth;
                    Height = Settings.Default.AppHeight;
                }
                DataContext = app = splash.ViewModel.Data;
                Closing    += OnClosing;

                TreeNode c = new TreeNode
                {
                    Element = CommonControls.WorkspaceExplorer
                };

                TreeNode d = new TreeNode
                {
                    Element = CommonControls.Outline
                };

                TreeNode a = new TreeNode
                {
                    Element = CommonControls.MainContent
                };

                TreeNode b = new TreeNode
                {
                    A            = c,
                    B            = d,
                    Distribution = 0.6,
                    Orientation  = System.Windows.Controls.Orientation.Vertical
                };

                c.Parent = d.Parent = b;


                TreeNode node = new TreeNode
                {
                    A            = b,
                    B            = a,
                    Distribution = 0.2,
                    Orientation  = System.Windows.Controls.Orientation.Horizontal
                };

                b.Parent = a.Parent = node;

                app.ContentTree = node;
            }
            else
            {
                Close();
            }
        }