private void Initialise(Lifetime lifetime, UpdatesManager updatesManager) { var uri = new Uri("https://hg.codeplex.com/xunitcontrib/raw-file/tip/updates.xslt"); var category = updatesManager.Categories.AddOrActivate("xunitcontrib", uri); category.CustomizeLocalEnvironmentInfo.Advise(lifetime, args => { // We can customise the local environment info that the xslt will be applied to // It should be an instance of UpdateLocalEnvironmentInfo, bail out early if it's // not. The only reason it wouldn't be is if someone has got hold of the "xunitcontrib" // category and subscribed to the CustomizeLocalEnvironmentInfo signal. Unlikely. if (!(args.Out is UpdateLocalEnvironmentInfoVs)) { return; } // Set the data the xslt will be applied against. Pass in the current environment, // in case we ever need it, but really, we only care about the current version args.Out = new PluginLocalEnvironmentInfo { LocalEnvironment = args.Out as UpdateLocalEnvironmentInfoVs, PluginVersion = new UpdateLocalEnvironmentInfo.VersionSubInfo(GetThisVersion()) }; }); RemoveStaleUpdateNotification(category); }
public TestUpdateNotifier(UpdatesManager manager, JetBrains.Application.Communication.WebProxySettingsReader reader) { var category = manager.Categories.FirstOrDefault(c => c.Key == "xunitcontrib"); var updateXsltTestResult = manager.TestUpdatesXstl(category.Value, reader); Console.WriteLine(); }
void Awake() { _light = GetComponent <Light>(); UpdateRememberedValues(); switch (_light.shadows) { case LightShadows.None: _hardShadowsValue = LightShadows.None; _softShadowsValue = LightShadows.None; break; case LightShadows.Hard: _hardShadowsValue = LightShadows.Hard; _softShadowsValue = LightShadows.Hard; break; case LightShadows.Soft: _hardShadowsValue = LightShadows.Hard; _softShadowsValue = LightShadows.Soft; break; } UpdatesManager.Subscribe(OnUpdate, 0.1f); // 10 times per second }
public TestUpdateNotifier(UpdatesManager manager, JetBrains.Application.Communication.WebProxySettingsReader reader) { var category = manager.Categories.FirstOrDefault(c => c.Key == "xunitcontrib"); var updateXsltTestResult = manager.TestUpdatesXstl(category.Value, reader); Console.WriteLine(); }
public UpdatesNotifier(Lifetime lifetime, UpdatesManager updatesManager) { var uri = new Uri("https://raw.github.com/hmemcpy/Nancy-ReSharper-Plugin/master/updates.xslt"); var category = updatesManager.Categories.AddOrActivate("NancyFxSupport", uri); category.CustomizeLocalEnvironmentInfo.Advise(lifetime, args => { // We can customize the local environment info that the xslt will be applied to // It should be an instance of UpdateLocalEnvironmentInfo, bail out early if it's // not. The only reason it wouldn't be is if someone has got hold of the "NancyFxSupport" // category and subscribed to the CustomizeLocalEnvironmentInfo signal. Unlikely. if (!(args.Out is UpdateLocalEnvironmentInfoVs)) return; // Set the data the xslt will be applied against. Pass in the current environment, // in case we ever need it, but really, we only care about the current version args.Out = new PluginLocalEnvironmentInfo { LocalEnvironment = args.Out as UpdateLocalEnvironmentInfoVs, PluginVersion = new UpdateLocalEnvironmentInfo.VersionSubInfo(GetThisVersion()) }; }); RemoveStaleUpdateNotification(category); }
public UpdatesNotifier(Lifetime lifetime, UpdatesManager updatesManager) { var uri = new Uri("https://raw.github.com/hmemcpy/Nancy-ReSharper-Plugin/master/updates.xslt"); var category = updatesManager.Categories.AddOrActivate("NancyFxSupport", uri); category.CustomizeLocalEnvironmentInfo.Advise(lifetime, args => { // We can customize the local environment info that the xslt will be applied to // It should be an instance of UpdateLocalEnvironmentInfo, bail out early if it's // not. The only reason it wouldn't be is if someone has got hold of the "NancyFxSupport" // category and subscribed to the CustomizeLocalEnvironmentInfo signal. Unlikely. if (!(args.Out is UpdateLocalEnvironmentInfoVs)) { return; } // Set the data the xslt will be applied against. Pass in the current environment, // in case we ever need it, but really, we only care about the current version args.Out = new PluginLocalEnvironmentInfo { LocalEnvironment = args.Out as UpdateLocalEnvironmentInfoVs, PluginVersion = new UpdateLocalEnvironmentInfo.VersionSubInfo(GetThisVersion()) }; }); RemoveStaleUpdateNotification(category); }
private void CheckForUpdatesWithUserInteraction(bool notifyWhenNoUpdatesAvailable) { this.UpdateUI(() => { CheckForUpdatesButton.Enabled = false; PatchListView.Focus(); }); var checkForUpdates = new Action(() => { var newPatches = UpdatesManager.CheckForNewPatches(m_firmware.Definition, m_suitablePatches); this.UpdateUI(() => { CheckForUpdatesButton.Enabled = true; if (newPatches == null || newPatches.Count == 0) { if (notifyWhenNoUpdatesAvailable) { InfoBox.Show("No updates available!"); } return; } using (var newPatchesWindow = new PatchUpdatesAvailableWindow(m_firmware.Definition, newPatches)) { if (newPatchesWindow.ShowDialog() != DialogResult.OK) { return; } ReloadPatchesButton_Click(null, EventArgs.Empty); } }); }); checkForUpdates.BeginInvoke(null, null); }
public UpdatesNotifier(Lifetime lifetime, UpdatesManager updatesManager, SimpleExtensionManager extensionManager) { // If we're installed as part of the extension manager, we don't need to worry about updates if (!extensionManager.IsInstalled()) { Initialise(lifetime, updatesManager); } }
public void UpdateInterval() { if (enabled) { UpdatesManager.UnSubscribe(onInterval.Invoke); UpdatesManager.Subscribe(onInterval.Invoke, interval); } }
private void CheckForUpdates(bool isAutoUpdate) { UpdatesManager _updater = new UpdatesManager(isAutoUpdate, UPDATES_HOST, UPDATES_REPOSITORY); _updater.Processing += _update_Processing; _updater.Processed += _update_Processed; OverlayAdornerHelper _adorner = new OverlayAdornerHelper(this.DockManager, new LoadingScreen("Checking for updates...", false)); Helpers.DoEvents(); //btnUpdateButton.IsEnabled = false; _updater.CheckUpdates(); }
private void CheckForUpdatesMenuItem_Click(object sender, EventArgs e) { CheckForUpdatesMenuItem.Enabled = false; var checkForUpdatesAction = new Action(() => { var releaseInfo = UpdatesManager.CheckForNewRelease(Consts.ApplicationVersion); this.UpdateUI(() => CheckForUpdatesMenuItem.Enabled = true); if (releaseInfo == null) { InfoBox.Show("You are using latest version!"); } else { ShowUpdatesWindow(new UpdatesInfo { Release = releaseInfo }); } }); checkForUpdatesAction.BeginInvoke(null, null); }
private void Initialise(Lifetime lifetime, UpdatesManager updatesManager) { var uri = new Uri("https://hg.codeplex.com/xunitcontrib/raw-file/tip/updates.xslt"); var category = updatesManager.Categories.AddOrActivate("xunitcontrib", uri); category.CustomizeLocalEnvironmentInfo.Advise(lifetime, args => { // We can customise the local environment info that the xslt will be applied to // It should be an instance of UpdateLocalEnvironmentInfo, bail out early if it's // not. The only reason it wouldn't be is if someone has got hold of the "xunitcontrib" // category and subscribed to the CustomizeLocalEnvironmentInfo signal. Unlikely. if (!(args.Out is UpdateLocalEnvironmentInfoVs)) return; // Set the data the xslt will be applied against. Pass in the current environment, // in case we ever need it, but really, we only care about the current version args.Out = new PluginLocalEnvironmentInfo { LocalEnvironment = args.Out as UpdateLocalEnvironmentInfoVs, PluginVersion = new UpdateLocalEnvironmentInfo.VersionSubInfo(GetThisVersion()) }; }); RemoveStaleUpdateNotification(category); }
void OnEnable() { UpdatesManager.Subscribe(onInterval.Invoke, interval); }
public UpdatesNotifier(Lifetime lifetime, UpdatesManager updatesManager, SimpleExtensionManager extensionManager) { // If we're installed as part of the extension manager, we don't need to worry about updates if (!extensionManager.IsInstalled()) Initialise(lifetime, updatesManager); }
public UpdatesForTeaCategoryOwner([NotNull] Lifetime lifetime, [NotNull] UpdatesManager updatesManager) { _category = updatesManager.Categories.AddOrActivate("ForTea", new Uri("https://raw.github.com/MrJul/ForTea/master/Updates.xslt")); _category.CustomizeLocalEnvironmentInfo.Advise(lifetime, CustomizeLocalEnvironmentInfo); }
void OnDisable() { UpdatesManager.UnSubscribe(onInterval.Invoke); }
void OnDestroy() { UpdatesManager.UnSubscribe(OnUpdate); }
public void ProcessRequestInfo(User user, byte[] buffer) { MsgRequestInfo msg = new MsgRequestInfo(buffer); if (user.IsBanned || !Kernel.AllowedUsers.ContainsKey(user.MacAddress)) { Program.WriteLog($"User [{user.IpAddress}::{user.MacAddress}] is not allowed to download patches.", LogType.WARNING); msg.CurrentVersion = ushort.MaxValue; user.Send(msg); return; } Program.WriteLog($"User [{user.IpAddress}::{user.MacAddress}] has requested updates with current version: {msg.CurrentVersion}."); List <PatchStructure> updates = UpdatesManager.GetDownloadList(msg.CurrentVersion); switch (msg.Mode) { case AutoUpdateRequestType.CheckForLauncherUpdates: if (updates.Count > 0) { MsgDownloadInfo pMsg = new MsgDownloadInfo { Mode = UpdateDownloadType.UpdaterPatch, LatestVersion = (ushort)Kernel.LatestUpdaterPatch }; pMsg.Append(Kernel.DownloadUrl); foreach (var patch in updates) { pMsg.Append(patch.FileName); } user.Send(pMsg); } else { msg.Mode = AutoUpdateRequestType.LauncherUpdatesOk; user.Send(msg); } break; case AutoUpdateRequestType.CheckForGameUpdates: if (updates.Count > 0) { MsgDownloadInfo pMsg = new MsgDownloadInfo { Mode = UpdateDownloadType.GameClientPatch, LatestVersion = (ushort)Kernel.LatestGamePatch }; pMsg.Append(Kernel.DownloadUrl); foreach (var patch in updates) { pMsg.Append(patch.FileName); } user.Send(pMsg); } else { msg.Mode = AutoUpdateRequestType.GameUpdatesOk; user.Send(msg); } break; } }