コード例 #1
0
        private void UpdateDockyard(Dockyard dockyard)
        {
            this.dockyardDisposables?.Dispose();
            this.dockyardDisposables = new LivetCompositeDisposable();

            foreach (var dock in dockyard.Docks.Values)
            {
                dock.Completed += this.HandleDockyardCompleted;
                this.dockyardDisposables.Add(() => dock.Completed -= this.HandleDockyardCompleted);
            }
        }
コード例 #2
0
        private static void UpdateDockyard(Dockyard dockyard)
        {
            foreach (var dock in dockyard.Docks.Values)
            {
                dock.Completed += (sender, args) =>
                {
                    if (Settings.Current.NotifyBuildingCompleted)
                    {
                        var shipName = Settings.Current.CanDisplayBuildingShipName
                                                        ? args.Ship.Name
                                                        : Resources.Common_ShipGirl;

                        PluginHost.Instance.GetNotifier().Show(
                            Resources.Dockyard_NotificationMessage_Title,
                            string.Format(Resources.Dockyard_NotificationMessage, args.DockId, shipName),
                            () => Application.Instance.MainWindowViewModel.Activate());
                    }
                };
            }
        }