示例#1
0
        private void AutoUpdateCallback(object sender, AutoUpdateEventArgs e)
        {
            Action method = delegate
            {
                //switch (e.ProgressBarStyle)
                //{
                //    case ProgressBarStateEnum.UnEnable:
                //        this.progressBar.Visibility = System.Windows.Visibility.Visible;
                //        break;
                //    case ProgressBarStateEnum.Continue:
                //        this.progressBar.Visibility = System.Windows.Visibility.Hidden;
                //        this.progressBar.IsIndeterminate = false;
                //        break;
                //    case ProgressBarStateEnum.Marquee:
                //        this.progressBar.Visibility = System.Windows.Visibility.Visible;
                //        this.progressBar.IsIndeterminate = true;
                //        break;
                //}
                if (e.TotleSize != 0)
                {
                    this.progressBar.Value = e.UpdateSize * 100 / e.TotleSize;
                }
                //this.lblInfoShower.Text += e.Info + "\r\n";
                this.tbUpdating.Text = e.Info;
            };

            this.Dispatcher.Invoke(method);
        }
示例#2
0
 private void OnConfigEntryChanged(object sender, AutoUpdateEventArgs args)
 {
     AliveList().ForEach(cm => {
         if (cm.hasBody)
         {
             UpdateGGBuff(cm.GetBody());
         }
     });
 }
示例#3
0
 private void Evt_ConfigEntryChanged(object sender, AutoUpdateEventArgs args)
 {
     AliveList().ForEach(cm => {
         if (cm.hasBody)
         {
             updateBarbedWard(cm.GetBody());
         }
     });
 }
 private void Evt_ConfigEntryChanged(object sender, AutoUpdateEventArgs args)
 {
     if (args.target.boundProperty.Name == nameof(baseFuel) || args.target.boundProperty.Name == nameof(stackFuel))
     {
         AliveList().ForEach(cm => {
             if (cm.hasBody)
             {
                 UpdatePhotonFuel(cm.GetBody());
             }
         });
     }
 }
 /// <summary>Internal handler for ConfigEntryChanged event.</summary>
 internal void OnConfigChanged(AutoUpdateEventArgs e)
 {
     ConfigEntryChanged?.Invoke(this, e);
     TILER2Plugin._logger.LogDebug(e.target.modName + "/" + e.target.configEntry.Definition.Section + "/" + e.target.configEntry.Definition.Key + ": " + e.oldValue.ToString() + " > " + e.newValue.ToString());
     if (!(Run.instance != null && Run.instance.isActiveAndEnabled))
     {
         return;
     }
     if ((e.flags & AutoUpdateEventFlags.InvalidateStats) == AutoUpdateEventFlags.InvalidateStats)
     {
         AutoItemConfigModule.globalStatsDirty = true;
     }
     if ((e.flags & AutoUpdateEventFlags.InvalidateDropTable) == AutoUpdateEventFlags.InvalidateDropTable)
     {
         AutoItemConfigModule.globalDropsDirty = true;
     }
     if (!e.silent && (e.flags & AutoUpdateEventFlags.AnnounceToRun) == AutoUpdateEventFlags.AnnounceToRun && NetworkServer.active)
     {
         NetConfigOrchestrator.ServerSendGlobalChatMsg("The setting <color=#ffffaa>" + e.target.modName + "/" + e.target.configEntry.Definition.Section + "/" + e.target.configEntry.Definition.Key + "</color> has been changed from <color=#ffaaaa>" + e.oldValue.ToString() + "</color> to <color=#aaffaa>" + e.newValue.ToString() + "</color>.");
     }
 }
示例#6
0
        protected virtual void AutoUpdateOnAutoUpdateChange(AutoUpdateEventArgs args)
        {
            try
            {
                switch (args.EventId)
                {
                case AutoUpdateEventIds.UpdateIsAvailable:
                    Debug.WriteSuccess("AutoUpdate Available", "Showing postpont prompt on all UIs");
                    _auPrompt = PromptUsers(prompt =>
                    {
                        if (prompt.Response.Responded)
                        {
                            AutoUpdate.PerformUpdateInResponseToEvent(prompt.Response.Action.ActionType ==
                                                                      PromptActionType.Acknowledge);
                        }
                    }, "System Update", "The system is about to commence an auto system update", 30, null,
                                            new PromptAction
                    {
                        ActionName = "Update Now",
                        ActionType = PromptActionType.Acknowledge
                    },
                                            new PromptAction
                    {
                        ActionName = "Postpone",
                        ActionType = PromptActionType.Cancel
                    });
                    break;

                case AutoUpdateEventIds.UpdateConfirmed:
                    Debug.WriteSuccess("AutoUpdate allowed by user");
                    _auPrompt = PromptUsers(prompt => { }, "System Update In Progress", "The system may restart",
                                            500, null);
                    break;

                case AutoUpdateEventIds.UpdateConfirmedViaTimeout:
                    Debug.WriteWarn("AutoUpdate prompt timed out .... continuing with update");
                    if (_auPrompt != null)
                    {
                        _auPrompt.Cancel();
                    }
                    break;

                case AutoUpdateEventIds.UpdateDenied:
                    Debug.WriteWarn("AutoUpdate denied by user");
                    break;

                case AutoUpdateEventIds.UpdateStartedWithNoConfirmation:
                    Debug.WriteWarn("AutoUpdate Started With No Confirmation!");
                    _auPrompt = PromptUsers(prompt => { }, "System Update In Progress", "The system may restart",
                                            500, null);
                    break;

                case AutoUpdateEventIds.ErrorMessage:
                    if (AutoUpdate.LastErrorReceived.Length > 0)
                    {
                        CloudLog.Error("AutoUpdate error: {0}", AutoUpdate.LastErrorReceived);
                    }
                    break;

                case AutoUpdateEventIds.UpdateFinished:
                    Debug.WriteSuccess("AutoUpdate Complete");
                    if (_auPrompt != null && _auPrompt.State == PromptState.Shown)
                    {
                        _auPrompt.Cancel();
                    }
                    break;

                default:
                    Debug.WriteNormal("AutoUpdate State", "{0}  ({1})", AutoUpdate.AutoUpdateState, args.EventId);
                    break;
                }
            }
            catch (Exception e)
            {
                CloudLog.Exception(e);
            }
        }