Exemplo n.º 1
0
        private void Window_Opened(object sender, EventArgs e)
        {
            Height = _prefsShown ? 477 : 277;
            Width  = 504;

            if (Environment.OSVersion.Version.Major > 5 && ConfigManager.SettingsManager.LoadSetting("ControlCenter", "AeroWarning", true))
            {
                bool aeroEnabled;
                NativeMethods.DwmIsCompositionEnabled(out aeroEnabled);
                if (!aeroEnabled)
                {
                    AeroWarning warningDialog = new AeroWarning();
                    warningDialog.Owner = this;
                    warningDialog.ShowDialog();

                    if (warningDialog.DisplayAgainCheckbox.IsChecked == true)
                    {
                        ConfigManager.SettingsManager.SaveSetting("ControlCenter", "AeroWarning", false);
                    }
                }
            }

            App app = Application.Current as App;

            if (app != null && app.StartupProfile != null && File.Exists(app.StartupProfile))
            {
                LoadProfileList(app.StartupProfile);
                LoadProfile(app.StartupProfile);
                StartProfile();
            }

            VersionChecker.CheckVersion();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handles the DoWork event of the worker control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.ComponentModel.DoWorkEventArgs"/> instance containing the event data.</param>
        void worker_DoWork(object sender, DoWorkEventArgs e)
        {
            showFrmVersionInfo = sender == null;

            currentVersionInfo.AssemblyVersion = frmAbout.AssemblyVersion;
            try
            {
                versionChecker.InitProxySettings();
                versionChecker.CheckVersion(currentVersionInfo);
            }
            catch (Exception ex)
            {
                tslblStatus.Text = ex.Message;

                // show error to user in MessageBox
                if (showFrmVersionInfo)
                {
                    MessageBox.Show(ex.Message, "Network Error",
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }

            if (e != null)
            {
                e.Cancel = true;
            }
        }
Exemplo n.º 3
0
        protected override void ProcessRecord()
        {
            cancellationTokenSource = new CancellationTokenSource();
            CancellationToken token = cancellationTokenSource.Token;

#pragma warning disable CS0618 // NoTelemetry and NoVersionCheck needs to be set through environment variables now
            if (NoTelemetry)
            {
                Environment.SetEnvironmentVariable("PNPPOWERSHELL_DISABLETELEMETRY", "true");
            }
            if (NoVersionCheck)
            {
                Environment.SetEnvironmentVariable("PNPPOWERSHELL_UPDATECHECK", "false");
            }
#pragma warning restore CS6018



            VersionChecker.CheckVersion(this);
            try
            {
                Connect(ref token);
            }
            catch (Exception ex)
            {
                ex.Data["TimeStampUtc"] = DateTime.UtcNow;
                throw;
            }
        }
Exemplo n.º 4
0
        private async void MenuItem_Click_1(object sender, RoutedEventArgs e)
        {
            ((MenuItem)sender).IsEnabled = false;
            await VersionChecker.CheckVersion();

            ((MenuItem)sender).IsEnabled = true;
        }
Exemplo n.º 5
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            AppState.Current.Window = this;
            ScriptEngine.Create();
            AppEvents.InvokeStartup();

#pragma warning disable CS4014 // This call is executed on an another thread entirely, the await is thus not needed.
            new Thread(() => VersionChecker.CheckVersion(false, true, (s) => this.Dispatcher.Invoke(() => UpdateManager.Update(s)))).Start();
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed

            if (!string.IsNullOrEmpty(this.OldWindowSaveData))
            {
                AppState.Current.Load(this.OldWindowSaveData, out _);
                this.OldWindowSaveData = null;
            }
            else
            {
                // opening a new empty window
                AppState.Current.Save();
                AppState.Current.ResetDefaultSaveFile();
            }

            this.Language_English.IsChecked = Settings.Default.Language.Equals("en-US");
            this.Language_Russian.IsChecked = Settings.Default.Language.Equals("ru-RU");
            this.Skin_Default.IsChecked     = Settings.Default.Skin == 0;
            this.Skin_Bright.IsChecked      = Settings.Default.Skin == 1;
            this.Skin_Dark.IsChecked        = Settings.Default.Skin == 2;
            this.Skin_Soft.IsChecked        = Settings.Default.Skin == 3;
            this.CB_Autoupdate.IsChecked    = Settings.Default.AutoUpdate;
            this.CB_PromptUpdates.IsChecked = !Settings.Default.HideUpdateNotification;
        }
Exemplo n.º 6
0
        protected override void OnActivated()
        {
            base.OnActivated();

            string version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

            VersionChecker vers = new VersionChecker();

            if (MainClass.User != null)
            {
                vers.CheckVersion(version, MainClass.User.Token, CheckVersionWriteLogin, test);
            }
            else
            {
                vers.CheckVersion(version, "", CheckVersionWriteNoLogin, test);
            }
        }
        protected override void OnStartup(StartupEventArgs e)
        {
            VersionChecker.CheckVersion("v0.9");

            Current.DispatcherUnhandledException += new DispatcherUnhandledExceptionEventHandler(DispatcherUnhandledExceptionHandler);

            _config = new DependencyInjectionConfig();
            _config.ShowMainWindow();
        }
Exemplo n.º 8
0
        public IActionResult Version()
        {
            var latest = _version.CheckVersion();

            return(this.ChatJson(new VersionViewModel
            {
                LatestVersion = latest,
                OldestSupportedVersion = latest,
                Message = "成功的获取了当前最新版本号.",
                DownloadAddress = ""
            }));
        }
Exemplo n.º 9
0
 public MainForm()
 {
     InitializeComponent();
     Logger.Init();
     Logger.Log("");
     Logger.Log("Starting application...");
     registryButton.Enabled = false;
     assignButton.Enabled   = false;
     exportButton.Enabled   = false;
     ICAO.Build();
     VersionChecker.CheckVersion();
 }
Exemplo n.º 10
0
        // Method used to check the website for any indication that there is a new version available
        private async Task CheckForNewVersion()
        {
            // Aynchronously check for a new version
            VersionChecker.VersionState result = await Task.Run(() => VersionChecker.CheckVersion(Core.UpdateUrl)).ConfigureAwait(false);

            // If the check shows there's a new version available
            if (result.IsNewVersion)
            {
                // Pass this result back to the inherited form (to show this in the context menu)
                base.HasNewVersion(result);
            }
        }
Exemplo n.º 11
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            Logger.Log("");
            Logger.Log("Application started - build " + VersionChecker.buildVersion);
            Logger.Log(System.Environment.OSVersion.VersionString);
            //Logger.Log(System.Environment.Version.ToString());

            this.pilotInfoToolStripMenuItem.Enabled     = false;
            this.helpToolStripMenuItem.Enabled          = false;
            this.startNewACARSToolStripMenuItem.Enabled = false;
            this.socketCommToolStripMenuItem.Enabled    = false;

            VersionChecker.CheckVersion();
            showLogin();
        }
Exemplo n.º 12
0
 private void NewVersionCheck_Click(object sender, RoutedEventArgs e)
 {
     VersionChecker.CheckVersion();
 }
Exemplo n.º 13
0
 public void TestCheckVersionAutoNew()
 {
     versionInfo.AssemblyVersion = new Version(1, 2, 0, 0);
     versionChecker.CheckVersion(versionInfo);
 }
Exemplo n.º 14
0
        public MainWindow()
        {
            InitializeComponent();

            #if !DEBUG
            AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs eventArgs)
            {
                new ExtendedErrorView("FFXIVMon Reborn ran into an error and needs to close.",
                                      eventArgs.ExceptionObject.ToString(), "Unhandled Exception").ShowDialog();

                Process.GetCurrentProcess().Kill();
            };
            #endif

            bool loadedByArg = false;
            var  args        = Environment.GetCommandLineArgs();
            for (var i = 1; i + 1 < args.Length; i += 2)
            {
                if (args[i] == "--xml")
                {
                    var tab = new TabItem();

                    tab.Content = new XivMonTab();
                    tab.Header  = "New Capture";
                    ((XivMonTab)tab.Content).SetParents(tab, this);
                    MainTabControl.Items.Add(tab);
                    ((XivMonTab)tab.Content).LoadCapture(args[i + 1]);

                    loadedByArg = true;
                }
            }

            if (!loadedByArg)
            {
                var item = new TabItem();
                item.Content = new XivMonTab();
                item.Header  = "New Capture";
                ((XivMonTab)item.Content).SetParents(item, this);
                MainTabControl.Items.Add(item);
            }


            // register the event that is fired after the key press.
            _kbHook.KeyPressed += hook_KeyPressed;

            try
            {
                _kbHook.RegisterHotKey(ModifierKeys.Control | ModifierKeys.Alt, Keys.F12);
            }
            catch (Exception)
            {
                // ignored
            }

            CaptureMode = (TCPNetworkMonitor.NetworkMonitorType)Properties.Settings.Default.NetworkMonitorType;

            if (CaptureMode == TCPNetworkMonitor.NetworkMonitorType.RawSocket)
            {
                SwitchModeSockets.IsChecked = true;
            }
            else
            {
                SwitchModePcap.IsChecked = true;
            }

            try
            {
                ExdReader.Init(Properties.Settings.Default.GamePath);
            }
            catch (Exception exc)
            {
                new ExtendedErrorView("Unable to init EXD data. Please check your game path in Options -> Set Game Path.", exc.ToString(), "FFXIVMon Reborn").ShowDialog();
                Properties.Settings.Default.LoadEXD = false;
            }

            if (!Properties.Settings.Default.DontUsePacketTimestamp)
            {
                DontUsePacketTimestamp.IsChecked = false;
                Properties.Settings.Default.DontUsePacketTimestamp = false;
            }
            else
            {
                CaptureFlags |= MachinaCaptureWorker.ConfigFlags.DontUsePacketTimestamp;
                DontUsePacketTimestamp.IsChecked = true;
                Properties.Settings.Default.DontUsePacketTimestamp = true;
            }

            if (Properties.Settings.Default.ForceRealtimePriority)
            {
                Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime;
                ForceRealtimePriority.IsChecked = true;
            }

            if (Properties.Settings.Default.LoadEXD)
            {
                ExEnabledCheckbox.IsChecked = true;
            }

            if (Properties.Settings.Default.EnableFsWatcher)
            {
                WatchDefFilesCheckBox.IsChecked = true;
            }

            if (Properties.Settings.Default.HideHexBoxActorId)
            {
                HideHexBoxActorIdCheckBox.IsChecked = true;
            }

            VersioningProvider.LocalDbChanged += VersioningProviderOnLocalDbChanged;
            ScriptDebugView.Show();
            ScriptDebugView.Visibility = Visibility.Hidden;

            VersionChecker.CheckVersion();
        }