Exemple #1
0
        private async void openAboutDialog(object obj)
        {
            var view = new AboutControl
            {
                DataContext = new AboutViewModel()
            };

            bool result = (bool)await DialogHost.Show(view, "RootDialog");
        }
        public ButtplugTabControl()
        {
            _guiLog = LogManager.GetCurrentClassLogger();
            LogManager.Configuration = LogManager.Configuration ?? new LoggingConfiguration();
#if DEBUG
            // Debug Logger Setup
            var t = new DebuggerTarget();
            LogManager.Configuration.AddTarget("debugger", t);
            LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, t));
            LogManager.Configuration = LogManager.Configuration;
#endif

            try
            {
                _ravenClient = new RavenClient("SENTRY_API_URL");
            }
            catch (ArgumentException)
            {
                _guiLog.Error("Sentry URL invalid, cannot submit crash reports!");
            }

            // Cover all of the possible bases for WPF failure
            // http://stackoverflow.com/questions/12024470/unhandled-exception-still-crashes-application-after-being-caught
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;

            // Null check application, otherwise test bringup for GUI tests will fail
            if (Application.Current != null)
            {
                Application.Current.DispatcherUnhandledException += CurrentOnDispatcherUnhandledException;
            }

            // Set up GUI
            InitializeComponent();

            try
            {
                AboutControl.InitializeVersion();
                var version = AboutControl.GetAboutVersion();
                _guiLog.Info($"B******g Server Revision: {version}");
            }
            catch (Exception)
            {
                // TODO Make this catch far more granular
                _guiLog.Info("Can't load assembly file, no version info available!");
            }

            AboutControl.AboutImageClickedABunch += (aObj, aEvent) => DeveloperTab.Visibility = Visibility.Visible;
            DevicesTab.Visibility = Visibility.Collapsed;
            DeviceControl.DeviceSelectionChanged += OnSelectedDevicesChanged;
        }
        internal AboutControl OpenAbout()
        {
            string       window_key       = "About";
            AboutControl existing_control = (AboutControl)main_window.DockingManager.MakeActive(window_key);

            if (null != existing_control)
            {
                return(existing_control);
            }
            else
            {
                AboutControl about_control = new AboutControl();
                main_window.DockingManager.AddContent(window_key, "About Qiqqa", Icons.GetAppIcon(Icons.About), true, true, about_control);
                return(about_control);
            }
        }
Exemple #4
0
    public void Init(Settings settings)
    {
        Settings = settings;
        Settings.CustomSitesDir = App.CustomSiteDir;
        Settings.SiteManager    = new SiteManager(Settings);
        DataContext             = Settings;

        Closing              += OnClosing;
        PreviewKeyDown       += OnPreviewKeyDown;
        MouseLeftButtonDown  += delegate { DragMove(); };
        Ex.ShowMessageAction += ShowMessage;

        // logo
        LogoImageButton.MouseRightButtonDown += LogoImageButtonOnMouseRightButtonDown;

        // menu
        DownloaderMenuCheckBox.Checked   += DownloaderMenuCheckBoxCheckChanged;
        DownloaderMenuCheckBox.Unchecked += DownloaderMenuCheckBoxCheckChanged;

        // user ctrl
        AboutControl.Init();
        SearchControl.Init(Settings);
        MoeDownloaderControl.Init(Settings);
        MoeSettingsControl.Init(Settings);
        MoeExplorer.Init(Settings);

        // helper : collect ,log
        CollectCopyAllButton.Click += delegate { CollectTextBox.Text.CopyToClipboard(); };
        CollectClearButton.Click   += delegate { CollectTextBox.Text = string.Empty; };
        new LogWindowHelper().Init(LogButton, Settings);

        ImageSizeSlider.MouseWheel += ImageSizeSliderOnMouseWheel;

        // egg
        new EggWindowHelper().Init(this);

        // gen custom test 请删除后运行
        if (Debugger.IsAttached)
        {
            var cus = new CustomSiteFactory();
            cus.GenTestSites();
            cus.OutputJson(App.CustomSiteDir);
        }

        // ali
        this.SetWindowFluent(settings);
    }
        public About()
        {
            this.InitializeComponent();

            var aboutControl = new AboutControl()
                               .SetDescription("Aplikacja pozwalająca znaleźć dowolną firmę znajdującą się w Krajowym Rejestrze Sądowym")
                               .AddEmail("*****@*****.**", "App support")
                               .AddGitHub("sokolmichal95")
                               .AddVersion();

            this.AboutPageItem.Content = aboutControl;
            var rootFrame = Window.Current.Content as Frame;

            rootFrame.Navigated += OnNavigated;
            SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested;
            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = rootFrame.CanGoBack ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
        }
        public void Init(Settings settings)
        {
            Settings    = settings;
            SiteManager = new SiteManager(Settings);

            DataContext               = Settings;
            Closing                  += OnClosing;
            PreviewKeyDown           += OnPreviewKeyDown;
            MouseLeftButtonDown      += (sender, args) => DragMove();
            Extend.ShowMessageAction += ShowMessage;

            // menu : setting ,downloader, about
            DownloaderMenuCheckBox.Checked   += DownloaderMenuCheckBoxCheckChanged;
            DownloaderMenuCheckBox.Unchecked += DownloaderMenuCheckBoxCheckChanged;
            MoeDownloaderControl.Init(Settings);
            MoeSettingsControl.Init(Settings);
            AboutControl.Init();
            ChangeModeButton.Click += ChangeModeButtonOnClick;

            // explorer
            MoeExplorer.Settings                            = Settings;
            MoeExplorer.NextPageButton.Click               += NextPageButtonOnClick;
            MoeExplorer.ImageItemDownloadButtonClicked     += MoeExplorerOnImageItemDownloadButtonClicked;
            MoeExplorer.DownloadSelectedImagesButton.Click += DownloadSelectedImagesButtonOnClick;
            MoeExplorer.SearchByAuthorIdAction             += SearchByAuthorIdAction;
            MoeExplorer.MoeItemPreviewButtonClicked        += MoeExplorerOnMoeItemPreviewButtonClicked;

            // search
            SearchControl.Init(SiteManager, Settings);
            SearchControl.SearchButton.Click  += SearchButtonOnClick;
            SearchControl.AccountButton.Click += AccountButtonOnClick;

            // helper : collect ,log
            MoeExplorer.OutputSelectedImagesUrlsButton.Click += OutputSelectedImagesUrlsButtonOnClick;
            CollectCopyAllButton.Click    += (sender, args) => CollectTextBox.Text.CopyToClipboard();
            CollectClearButton.Click      += (sender, args) => CollectTextBox.Text = string.Empty;
            Extend.LogAction              += Log;
            LogListBox.MouseRightButtonUp += LogListBoxOnMouseRightButtonUp;
            ImageSizeSlider.MouseWheel    += ImageSizeSliderOnMouseWheel;
            // egg
            LogoImageButton.Click += LogoImageButtonOnClick;
            ChangeBgImage();
        }
Exemple #7
0
        public AboutPage()
        {
            string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "extension.vsixmanifest");

            if (File.Exists(path))
            {
                var xDocument = XDocument.Load(path);
                Name    = xDocument.Descendants().First(x => x.Name.LocalName == "DisplayName").Value;
                Url     = xDocument.Descendants().First(x => x.Name.LocalName == "MoreInfo").Value;
                Version = xDocument.Descendants().First(x => x.Name.LocalName == "Identity").Attribute("Version").Value;
            }
            Name      = Name ?? GetAssemblyInfo <AssemblyProductAttribute>(a => a.Product);
            Version   = $"Version: {Version ?? Assembly.GetExecutingAssembly().GetName().Version.ToString()}";
            Copyright =
                $"{GetAssemblyInfo<AssemblyCopyrightAttribute>(a => a.Copyright)} {GetAssemblyInfo<AssemblyCompanyAttribute>(a => a.Company)}";
            aboutControl = new AboutControl {
                DataContext = this
            };
        }
Exemple #8
0
 void UpdateForm2()
 {
     // Set status labels.
     StatusIsAdminLabel.Text = WinAPI.IsVista
                         ? string.Format("Elevated: {0}", WinAPI.IsElevated())
                         : "";
     StatusIniLabel.Text = SettingManager.IniFileName;
     CheckEncoding(SettingManager.TmpFileName);
     CheckEncoding(SettingManager.IniFileName);
     // Show status values.
     MainStatusStrip.Visible = true;
     // Load PAD controls.
     ControlPads = new PadControl[4];
     for (int i = 0; i < ControlPads.Length; i++)
     {
         ControlPads[i]      = new Controls.PadControl(i);
         ControlPads[i].Name = string.Format("ControlPad{0}", i + 1);
         ControlPads[i].Dock = DockStyle.Fill;
         ControlPages[i].Controls.Add(ControlPads[i]);
         ControlPads[i].InitPadControl();
     }
     // Initialize pre-sets. Execute only after name of cIniFile is set.
     SettingsDatabasePanel.InitPresets();
     // Allow events after PAD control are loaded.
     MainTabControl.SelectedIndexChanged += new System.EventHandler(this.MainTabControl_SelectedIndexChanged);
     // Load about control.
     ControlAbout      = new AboutControl();
     ControlAbout.Dock = DockStyle.Fill;
     AboutTabPage.Controls.Add(ControlAbout);
     // Update settings map.
     UpdateSettingsMap();
     ReloadXinputSettings();
     //// start capture events.
     if (WinAPI.IsVista && WinAPI.IsElevated() && WinAPI.IsInAdministratorRole)
     {
         this.Text += " (Administrator)";
     }
 }