コード例 #1
0
ファイル: App.xaml.cs プロジェクト: ctguxp/dnSpy
        void HandleAppArgs(IAppCommandLineArgs appArgs)
        {
            if (appArgs.Activate && appWindow.MainWindow.WindowState == WindowState.Minimized)
            {
                WindowUtils.SetState(appWindow.MainWindow, WindowState.Normal);
            }

            var lang = GetLanguage(appArgs.Language);

            if (lang != null)
            {
                languageManager.Value.Language = lang;
            }

            if (appArgs.FullScreen != null)
            {
                appWindow.MainWindow.IsFullScreen = appArgs.FullScreen.Value;
            }

            if (appArgs.NewTab)
            {
                fileTabManager.Value.OpenEmptyTab();
            }

            var files = appArgs.Filenames.ToArray();

            if (files.Length > 0)
            {
                OpenFileInit.OpenFiles(fileTabManager.Value.FileTreeView, appWindow.MainWindow, files, false);
            }

            // The files were lazily added to the treeview. Make sure they've been added to the TV
            // before we process the remaining command line args.
            if (files.Length > 0)
            {
                Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => HandleAppArgs2(appArgs)));
            }
            else
            {
                HandleAppArgs2(appArgs);
            }
        }
コード例 #2
0
        void HandleAppArgs(IAppCommandLineArgs appArgs)
        {
            if (appArgs.Activate && appWindow.MainWindow.WindowState == WindowState.Minimized)
            {
                WindowUtils.SetState(appWindow.MainWindow, WindowState.Normal);
            }

            var lang = GetLanguage(appArgs.Language);

            if (lang != null)
            {
                languageManager.Value.SelectedLanguage = lang;
            }

            var files = appArgs.Filenames.ToArray();

            if (files.Length > 0)
            {
                OpenFileInit.OpenFiles(fileTreeView.Value, appWindow.MainWindow, files);
            }
        }