예제 #1
0
        public override void CreateFinder(Components.Finder.Finder finder)
        {
            if (CreateUI == false)
            {
                return;
            }

            _finderConfig = finder.Config;

            _finderWindow = new FinderWindow
            {
                Top         = finder.Config.Top,
                Left        = finder.Config.Left,
                Width       = finder.Config.Width,
                Height      = finder.Config.Height,
                DataContext = finder
            };

            _finderWindow.IsVisibleChanged += (sender, args) => _finderConfig.Visible = _finderWindow.IsVisible;
            _finderWindow.LocationChanged  += (sender, args) => _finderLocationJustChanged = true;
            _finderWindow.SizeChanged      += (sender, args) => _finderLocationJustChanged = true;
            _finderWindow.ObjectSelected   += (sender, args) => { GearsetResources.Console.Inspect(args.Name, args.Object); };

            if (_finderConfig.Visible)
            {
                _finderWindow.Show();
            }

            _windows.Add(_finderWindow);

            WindowHelper.EnsureOnScreen(_finderWindow);
            ElementHost.EnableModelessKeyboardInterop(_finderWindow);
        }
        public override void CreateFinder(Components.Finder.Finder finder)
        {
            if (CreateUI == false)
            {
                return;
            }

            _finderConfig = finder.Config;

            _finderWindowViewModel            = new FinderWindowViewModel();
            _finderWindowViewModel.SearchText = finder.Config.SearchText;
            _finderWindow = new FinderWindow {
                DataContext = _finderWindowViewModel, Padding = _windowPadding
            };
            _finderWindow.SizeChanged += (sender, args) =>
            {
                _finderConfig.Width  = _finderWindow.ActualWidth;
                _finderConfig.Height = _finderWindow.ActualHeight;
            };
            //TODO
            //_finderWindow.ObjectSelected += (sender, args) => { GearsetResources.Console.Inspect(args.Name, args.Object); };

            var finderTemplate = new DataTemplate(typeof(FinderWindowViewModel), parent =>
            {
                _finderWindow.Parent = parent;
                return(_finderWindow);
            });

            _gearsetUI.Resources.Add(finderTemplate.DataTemplateKey, finderTemplate);

            InitialiseWindow(_finderWindowViewModel, _finderConfig.Top, _finderConfig.Left, _finderConfig.Width, _finderConfig.Height, _finderConfig.Visible);

            _widgetWindowViewModel.FinderWindowVisible = finder.Config.Visible;
        }
예제 #3
0
        /// <summary>
        /// 새로운 창을 실행합니다.
        /// </summary>
        /// <param name="args"></param>
        static void ProcessWindow(string[] args)
        {
            switch (args[0])
            {
            case "artist_viewer":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    ArtistViewerWindow avw = new ArtistViewerWindow();
                    avw.Show();
                }));
                break;

            case "test":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    TestWindow tw = new TestWindow();
                    tw.Show();
                }));
                break;

            case "finder":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    FinderWindow fw = new FinderWindow();
                    fw.Show();
                }));
                break;

            case "article_info":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    ArticleInfoWindow aiw = new ArticleInfoWindow();
                    aiw.Show();
                }));
                break;

            case "patch_note":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    PatchNoteWindow pnw = new PatchNoteWindow();
                    pnw.Show();
                }));
                break;

            case "car":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    CustomArtistsRecommendWindow carw = new CustomArtistsRecommendWindow();
                    carw.Show();
                }));
                break;

            case "zip_viewer":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    ZipViewer zv = new ZipViewer();
                    zv.Show();
                }));
                break;

            case "series_manager":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    SeriesManager sm = new SeriesManager();
                    sm.Show();
                }));
                break;

            case "crawler":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    MangaCrawler mc = new MangaCrawler();
                    mc.Show();
                }));
                break;

            case "zip-listing":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    ZipListing zl = new ZipListing();
                    zl.Show();
                }));
                break;

            case "cc":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    CustomCrawler cc = new CustomCrawler();
                    cc.Show();
                }));
                break;

            case "editor":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    ScriptEditor ed = new ScriptEditor();
                    ed.Show();
                }));
                break;

            case "elo":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    RankSimulator rs = new RankSimulator();
                    rs.Show();
                }));
                break;

            case "ft":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    ForbiddenTester ft = new ForbiddenTester();
                    ft.Show();
                }));
                break;

            case "zip-artists":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    ZipArtists za = new ZipArtists();
                    za.Show();
                }));
                break;

            default:
                Console.Instance.WriteLine($"'{args[0]}' window is not found.");
                break;
            }
        }