Пример #1
0
        private static void UpdateFleets(Organization organization)
        {
            foreach (var fleet in organization.Fleets.Values)
            {
                fleet.Expedition.Returned += (sender, args) =>
                {
                    if (Settings.Current.NotifyExpeditionReturned)
                    {
                        PluginHost.Instance.GetNotifier().Show(
                            NotifyType.Expedition,
                            Resources.Expedition_NotificationMessage_Title,
                            string.Format(Resources.Expedition_NotificationMessage, args.FleetName),
                            () => App.ViewModelRoot.Activate());
                    }
                };

                fleet.State.Condition.Rejuvenated += (sender, args) =>
                {
                    if (Settings.Current.NotifyFleetRejuvenated)
                    {
                        PluginHost.Instance.GetNotifier().Show(
                            NotifyType.Rejuvenated,
                            "疲労回復完了",
                            string.Format("「{0}」に編成されている艦娘の疲労が回復しました。", args.FleetName),
                            () => App.ViewModelRoot.Activate());
                    }
                };
            }
        }
Пример #2
0
		private static void UpdateFleets(Organization organization)
		{
			foreach (var fleet in organization.Fleets.Values)
			{
				fleet.Expedition.Returned += (sender, args) =>
				{
					if (Settings.Current.NotifyExpeditionReturned)
					{
						PluginHost.Instance.GetNotifier().Show(
							NotifyType.Expedition,
							Resources.Expedition_NotificationMessage_Title,
							string.Format(Resources.Expedition_NotificationMessage, args.FleetName),
							() => App.ViewModelRoot.Activate());
					}
				};

				fleet.State.Condition.Rejuvenated += (sender, args) =>
				{
					if (Settings.Current.NotifyFleetRejuvenated)
					{
						PluginHost.Instance.GetNotifier().Show(
							NotifyType.Rejuvenated,
							Resources.Notifications_MoraleRestored,
							string.Format(Resources.Notifications_MoraleRestored_Details, args.FleetName),
							() => App.ViewModelRoot.Activate());
					}
				};

                fleet.State.HeavilyDamaged += (sender, args) =>
                    {
                        if (Settings.Current.NotifyCritical)
                        {
                            PluginHost.Instance.GetNotifier().Show(
                                NotifyType.Wounded,
                                Resources.Notifications_CriticalCondition_Title,
                                string.Format(Resources.Notifications_CriticalCondition, args.FleetName),
                                () => App.ViewModelRoot.Activate());
                        }
                    };
			}
		}
Пример #3
0
		private void UpdateFleets(Organization organization)
		{
			this.organizationDisposables?.Dispose();
			this.organizationDisposables = new LivetCompositeDisposable();

			foreach (var fleet in organization.Fleets.Values)
			{
				fleet.Expedition.Returned += this.HandleExpeditionReturned;
				this.organizationDisposables.Add(() => fleet.Expedition.Returned -= this.HandleExpeditionReturned);

				fleet.State.Condition.Rejuvenated += this.HandleConditionRejuvenated;
				this.organizationDisposables.Add(() => fleet.State.Condition.Rejuvenated -= this.HandleConditionRejuvenated);
			}
		}