コード例 #1
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public MainForm()
        {
            InitializeComponent();
            Init();

#if !APPX
            if (_sparkle == null && ConfigurationManager.AppSettings["checkForUpdates"] != "false")
            {
                _sparkle = new Sparkle(
                    String.IsNullOrEmpty(ConfigurationManager.AppSettings["appCastUrl"])
                                                ? "https://lstratman.github.io/EasyConnect/updates/EasyConnect.xml"
                                                : ConfigurationManager.AppSettings["appCastUrl"],
                    Icon,
                    SecurityMode.Strict,
                    "<DSAKeyValue><P>12ewCqvTWhA9MrRLFDyvohdnbTaNkktQCzu87Tolcs7pOQcwsA0wnZF5Tkp2m21H0Y4N5vILPttmXizYLUZUSndLRfJlBtKWJi45CrUVZaMsEgYECXNrxuPGt9U9guPX39xdn1wwB/8TZRmAzqVSyDnrNw6e+2Ln9EJUG6RwmVc=</P><Q>ydyEMyIgVPSHlJvv5pcp+/DE8wU=</Q><G>It/uZNoAH//7ZQDmcjMNtInYRQ4MJBAp3posEglTlsWHb/BcKLqDkd4R0FkL6T+ZCu8DeC7TK4bPiecWDPY9E3MRmtivCxJVGD3LPv1eTsuRl+MyOg4z6KsbPTtXFjnDdG1+0zm3hzKntzgHiY6OaHwJaYlyLMmlFoNePUo4zN4=</G><Y>J3eg75iIHjUqklOn/CUOR9FALbSz4LFiswBbQBAertYwWbjLvKnr85hMTLgoFKMW+s5PHJaTBSAMmZS4rLj01Rver12JcoXs9t/mwuJYSw6QNwIO1Oau1OXF4dqA8fOH/XCGGcRzMdLt8FxtzRTuU5H88afsg5yjui54ezg6c3U=</Y></DSAKeyValue>");

                _sparkle.UIFactory         = new NetSparkleUIFactory();
                _sparkle.CloseApplication += _sparkle_CloseApplication;

                _sparkle.StartLoop(
                    true,
                    true,
                    String.IsNullOrEmpty(ConfigurationManager.AppSettings["updateCheckMinutes"])
                                                ? TimeSpan.FromMinutes(60 * 24)
                                                : TimeSpan.FromMinutes(Convert.ToInt32(ConfigurationManager.AppSettings["updateCheckMinutes"])));
            }
#endif
        }
コード例 #2
0
        /// <summary>
        /// Initialize the controller.
        /// </summary>
        /// <param name="firstRun">Whether it is the first time that CmisSync is being run.</param>
        public virtual void Initialize(Boolean firstRun)
        {
            this.firstRun = firstRun;

            // Create the CmisSync folder and add it to the bookmarks
            bool syncFolderCreated = CreateCmisSyncFolder();

            if (syncFolderCreated)
            {
                //Dont add bookmark for Oris4
                AddToBookmarks();
            }

            if (firstRun)
            {
                ConfigManager.CurrentConfig.Notifications = true;
            }

            folderLock = new FolderLock(FoldersPath);

            autoUpdater = new Sparkle("http://update.oris4.com/versioninfo.xml")
            {
                //ShowDiagnosticWindow = true,
                //EnableSystemProfiling = true,
                //SystemProfileUrl = new Uri("http://update.oris4.com/profile.html"),
            };

            autoUpdater.StartLoop(true, true);
        }
コード例 #3
0
        public void UpdateAsync()
        {
            autoUpdater.checkLoopFinished += (sender, args) =>
            {
                autoUpdater.StopLoop();
            };

            autoUpdater.StartLoop(true, true);
        }
コード例 #4
0
ファイル: LoginView.xaml.cs プロジェクト: weijx-xa/test
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            this.TbUserName.Focus();
            var updateUrl = ConfigurationManager.AppSettings["api"];

            //自动升级
            System.Drawing.Icon icon =
                System.Drawing.Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
            _sparkle = new Sparkle(updateUrl + "/Installer/versioninfo.xml", icon);
            _sparkle.StartLoop(true, true, TimeSpan.FromHours(3));
        }
コード例 #5
0
ファイル: MainForm_Win32.cs プロジェクト: cixonline/cixreader
        /// <summary>
        /// Secondary MainForm initialisation.
        /// </summary>
        public void Initialise()
        {
            Application.AddMessageFilter(this);

            bool useBeta = Preferences.StandardPreferences.UseBeta;

            _sparkle = new Sparkle(useBeta ? Constants.BetaAppCastURL : Constants.AppCastURL);
            _sparkle.installAndRelaunch += _sparkle_installAndRelaunch;

            _sparkle.StartLoop(true);
        }
コード例 #6
0
        public Shell()
        {
            InitializeComponent();

            Application.AddMessageFilter(this);

            _sparkle = new Sparkle(Settings.Default.VersionInfoUri);
            _sparkle.ApplicationIcon       = Properties.Resources.r4dio_app.ToBitmap();
            _sparkle.ApplicationWindowIcon = Properties.Resources.r4dio_app;
            _sparkle.StartLoop(true, true);
        }
コード例 #7
0
ファイル: Form1.cs プロジェクト: zyj0021/netsparkle
        public Form1()
        {
            InitializeComponent();

            // remove the netsparkle key from registry
            try
            {
                Microsoft.Win32.Registry.CurrentUser.DeleteSubKeyTree("Software\\Microsoft\\NetSparkleTestApp");
            }
            catch { }

            _sparkle.StartLoop(true);
        }
コード例 #8
0
        public Form1()
        {
            InitializeComponent();

            _sparkle = new Sparkle("https://deadpikle.github.io/NetSparkle/files/sample-app/appcast.xml", SystemIcons.Application);
            // TLS 1.2 required by GitHub (https://developer.github.com/changes/2018-02-01-weak-crypto-removal-notice/)
            _sparkle.SecurityProtocolType = System.Net.SecurityProtocolType.Tls12;

            _sparkle.UpdateDetected += new UpdateDetected(_sparkle_updateDetected);
            //_sparkle.EnableSilentMode = true;
            //_sparkle.HideReleaseNotes = true;

            _sparkle.StartLoop(true);
        }
コード例 #9
0
        /// <summary>
        /// Initiates an update check for the application.
        /// </summary>
        /// <returns>True if the update process was started successfully, false otherwise.</returns>
        public void CheckForUpdate()
        {
            _sparkle.StopLoop();

            _sparkle = new Sparkle(
                String.IsNullOrEmpty(ConfigurationManager.AppSettings["appCastUrl"])
                                        ? "http://lstratman.github.io/EasyConnect/updates/EasyConnect.xml"
                                        : ConfigurationManager.AppSettings["appCastUrl"]);
            _sparkle.ApplicationWindowIcon = Icon;
            _sparkle.ApplicationIcon       = Icon.ToBitmap();
            _sparkle.checkLoopFinished    += _sparkle_checkLoopFinished;

            _sparkle.StartLoop(true, true);
        }
コード例 #10
0
        public MainWindow()
        {
            InitializeComponent();

            // remove the netsparkle key from registry
            try
            {
                Microsoft.Win32.Registry.CurrentUser.DeleteSubKeyTree("Software\\Microsoft\\NetSparkle.TestAppWPF");
            }
            catch { }

            _sparkle = new Sparkle("https://deadpikle.github.io/NetSparkle/files/sample-app/appcast.xml", SystemIcons.Application); //, "NetSparkleTestApp.exe");
            _sparkle.StartLoop(true, true);
        }
コード例 #11
0
ファイル: MainWindow.xaml.cs プロジェクト: Lucas-S/NetSparkle
        public MainWindow()
        {
            InitializeComponent();

            // remove the netsparkle key from registry
            try
            {
                Microsoft.Win32.Registry.CurrentUser.DeleteSubKeyTree("Software\\Microsoft\\NetSparkle.TestAppWPF");
            }
            catch { }

            _sparkle = new Sparkle("http://update.applimit.com/netsparkle/versioninfo.xml", SystemIcons.Application); //, "NetSparkleTestApp.exe");
            _sparkle.StartLoop(true, true);
        }
コード例 #12
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public MainForm()
        {
            InitializeComponent();
            Init();

            _sparkle = new Sparkle(
                String.IsNullOrEmpty(ConfigurationManager.AppSettings["appCastUrl"])
                                        ? "http://lstratman.github.io/EasyConnect/updates/EasyConnect.xml"
                                        : ConfigurationManager.AppSettings["appCastUrl"]);
            _sparkle.ApplicationWindowIcon = Icon;
            _sparkle.ApplicationIcon       = Icon.ToBitmap();

            _sparkle.StartLoop(true, true);
        }
コード例 #13
0
        public MainWindow()
        {
            InitializeComponent();

            // remove the netsparkle key from registry
            try
            {
                Microsoft.Win32.Registry.CurrentUser.DeleteSubKeyTree("Software\\Microsoft\\NetSparkle.TestAppWPF");
            }
            catch { }

            _sparkle = new Sparkle("http://update.applimit.com/netsparkle/versioninfo.xml", SystemIcons.Application); //, "NetSparkleTestApp.exe");
            _sparkle.StartLoop(true, true);
        }
コード例 #14
0
        public MainWindow()
        {
            InitializeComponent();

            // remove the netsparkle key from registry
            try
            {
                Microsoft.Win32.Registry.CurrentUser.DeleteSubKeyTree("Software\\Microsoft\\NetSparkle.TestAppWPF");
            }
            catch { }

            _sparkle = new Sparkle("https://deadpikle.github.io/NetSparkle/files/sample-app/appcast.xml", SystemIcons.Application); //, "NetSparkleTestApp.exe");
            _sparkle.RunningFromWPF = true;
            _sparkle.StartLoop(true, true);
        }
コード例 #15
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            _sparkleUpdater = new Sparkle(
                Helpers.Resource.Get <string>("BRAND_SPARKLE_URL"),
                System.Drawing.Icon.ExtractAssociatedIcon(Assembly.GetEntryAssembly().Location),
                SecurityMode.Unsafe)
            {
                ShowsUIOnMainThread = true,
                RelaunchAfterUpdate = true,
                UIFactory           = new SparkleUIFactory()
            };

            _sparkleUpdater.StartLoop(true, true, TimeSpan.FromHours(2));
            Loaded -= OnLoaded;
        }
コード例 #16
0
        public Form1()
        {
            InitializeComponent();

            _sparkle = new Sparkle("https://deadpikle.github.io/NetSparkle/files/sample-app/appcast.xml", SystemIcons.Application)
            {
                TrustEverySSLConnection = true,
            };

            _sparkle.UpdateDetected += new UpdateDetected(_sparkle_updateDetected);
            //_sparkle.EnableSilentMode = true;
            //_sparkle.HideReleaseNotes = true;

            _sparkle.StartLoop(true);
        }
コード例 #17
0
        public MainWindow()
        {
            InitializeComponent();

            // remove the netsparkle key from registry
            try
            {
                Microsoft.Win32.Registry.CurrentUser.DeleteSubKeyTree("Software\\Microsoft\\NetSparkle.TestAppWPF");
            }
            catch { }

            // set icon in project properties!
            string manifestModuleName = System.Reflection.Assembly.GetEntryAssembly().ManifestModule.FullyQualifiedName;
            var    icon = System.Drawing.Icon.ExtractAssociatedIcon(manifestModuleName);

            _sparkle = new Sparkle("https://deadpikle.github.io/NetSparkle/files/sample-app/appcast.xml", icon); //, "NetSparkleTestApp.exe");
            _sparkle.StartLoop(true, true);
        }
コード例 #18
0
        public Form1()
        {
            InitializeComponent();

            _sparkle = new Sparkle("https://update.applimit.com/netsparkle/versioninfo.xml")
            {
                ShowDiagnosticWindow    = true,
                TrustEverySSLConnection = true,
                //EnableSystemProfiling = true,
                //SystemProfileUrl = new Uri("http://update.applimit.com/netsparkle/stat/profileInfo.php")
            };

            _sparkle.UpdateDetected += new UpdateDetected(_sparkle_updateDetected);
            //_sparkle.EnableSilentMode = true;
            //_sparkle.HideReleaseNotes = true;

            _sparkle.StartLoop(true);
        }
コード例 #19
0
        public Form1()
        {
            InitializeComponent();

            _sparkle = new Sparkle("file://" + DirectoryOfTheApplicationExecutable + "../../../../Extras/Sample Appcast.xml", SystemIcons.Application)
                       //_sparkle = new Sparkle("https://update.applimit.com/netsparkle/versioninfo.xml")
            {
                TrustEverySSLConnection = true,
                //EnableSystemProfiling = true,
                //SystemProfileUrl = new Uri("http://update.applimit.com/netsparkle/stat/profileInfo.php")
            };

            _sparkle.UpdateDetected += new UpdateDetected(_sparkle_updateDetected);
            //_sparkle.EnableSilentMode = true;
            //_sparkle.HideReleaseNotes = true;

            _sparkle.StartLoop(true);
        }
コード例 #20
0
        public MainWindow()
        {
            InitializeComponent();

            // remove the netsparkle key from registry
            try
            {
                Microsoft.Win32.Registry.CurrentUser.DeleteSubKeyTree("Software\\Microsoft\\NetSparkle.TestAppWPF");
            }
            catch { }

            // set icon in project properties!
            string manifestModuleName = System.Reflection.Assembly.GetEntryAssembly().ManifestModule.FullyQualifiedName;
            var    icon = System.Drawing.Icon.ExtractAssociatedIcon(manifestModuleName);

            _sparkle = new Sparkle("https://deadpikle.github.io/NetSparkle/files/sample-app/appcast.xml", icon); //, "NetSparkleTestApp.exe");
            // TLS 1.2 required by GitHub (https://developer.github.com/changes/2018-02-01-weak-crypto-removal-notice/)
            _sparkle.SecurityProtocolType = System.Net.SecurityProtocolType.Tls12;
            _sparkle.StartLoop(true, true);
        }
コード例 #21
0
ファイル: InstanceManager.cs プロジェクト: Sarkie/ootd
        public InstanceManager()
        {
            InitializeComponent();

            if (GlobalPreferences.IsFirstRun)
            {
                trayIcon.ShowBalloonTip(2000, Resources.OotdRunning, Resources.RightClickToConfigure, ToolTipIcon.Info);

                Logger.Debug("First Run");
            }

            _graphics = CreateGraphics();

            // setup update checker.
            _sparkle = UnsafeNativeMethods.Is64Bit() ? new Sparkle(AppCast64Url, Resources.AppIcon) : new Sparkle(AppCast32Url, Resources.AppIcon);

            _sparkle.UpdateDetected        += OnSparkleOnUpdateDetectedShowWithToast;
            _sparkle.UpdateWindowDismissed += OnSparkleOnUpdateWindowDismissed;

            // check for updates every 20 days, but don't check on first run because we'll have 2 tooltips popup and will likely confuse the user.
            _sparkle.StartLoop(!GlobalPreferences.IsFirstRun, TimeSpan.FromDays(20));
        }
コード例 #22
0
ファイル: Main.xaml.cs プロジェクト: WildGenie/PuckControl
        public Main()
        {
            InitializeComponent();
            this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;

            System.Drawing.Icon windowIcon;
            Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/PuckControl;component/Assets/pcIcon.ico")).Stream;

            windowIcon = new System.Drawing.Icon(iconStream);

            _sparkle = new Sparkle("http://www.headsup.technology/download/betaupdates", windowIcon);
            _sparkle.StartLoop(true);

            _engine      = new GameEngine();
            _debugWindow = new DebugWindow(_engine);
            _debugWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            _newUserWindow = new NewUser();
            _newUserWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            _gameWindow       = new Game(_engine);
            _highScoresWindow = new HighScores(_engine);
            _highScoresWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            _settingsWindow = new Settings(_engine, _engine.SettingsRepository);
            _settingsWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;

            this.Closing += MainWindow_Closing;

            _games = FindGames();

            foreach (IGame gameType in _games)
            {
                IGame game = (IGame)Activator.CreateInstance(gameType.GetType());

                if (String.IsNullOrWhiteSpace(game.Name))
                {
                    continue;
                }

                TileButton tileButton = new TileButton();
                tileButton.BackgroundBrush = new SolidColorBrush(game.TileColor);
                tileButton.ButtonLabel     = game.Name;
                tileButton.DataContext     = tileButton;

                tileButton.Click += (s, e) =>
                {
                    _engine.LoadGame(gameType);
                    _gameWindow.Visibility = System.Windows.Visibility.Visible;
                    _gameWindow.Owner      = this;
                    this.Visibility        = System.Windows.Visibility.Hidden;
                    _engine.StartGame();
                };

                GameList.Children.Add(tileButton);
            }

            _engine.GameOver += _engine_GameOver;
            _engine.Users.CollectionChanged += (s, e) => { PopulateUserSelectionList(); };

            try
            {
                _engine.Init();
            }
            catch (NotSupportedException ex)
            {
                System.Windows.MessageBox.Show(ex.Message, "An error occured", MessageBoxButton.OK);
            }

            this.KeyDown         += MainWindow_KeyDown;
            this.ContentRendered += (s, e) =>
            {
                _newUserWindow.Owner = this;
                if (_engine.Users.Count() == 0)
                {
                    ShowNewUserDialog();
                }
                else
                {
                    PopulateUserSelectionList();
                }
            };

            this.Activated += Main_Activated;
        }
コード例 #23
0
        private void ButtonRunAutoUpdater_Click(object sender, RoutedEventArgs e)
        {
            _sparkle.StartLoop(false, UpdateInterval);

            runAutoUpdater.IsEnabled = false;
        }
コード例 #24
0
 public void StartLoop()
 {
     m_autoUpdator.StartLoop(true, TimeSpan.FromHours(5.0));
 }