Exemple #1
0
        public void OnClick(Window mainWindow, Instance instance)
        {
            if (instance != null)
            {
                if (this.StopMode)
                {
                    instance.Stop();
                    return;
                }

                if (this.StartMode)
                {
                    instance.Start();
                    return;
                }

                if (this.RecycleMode)
                {
                    instance.Recycle();
                    return;
                }

                if (this.KillMode)
                {
                    MainWindowHelper.KillProcess(instance);
                    return;
                }

                if (this.ChangeMode)
                {
                    this.DoChangeMode(mainWindow, instance);
                    return;
                }

                // if (this.FavoriteMode)
                // {
                // InstanceHelperEx.ToggleFavorite(mainWindow, instance);
                // return;
                // }

                // if (this.DisabledMode)
                // {
                // instance.IsDisabled = !instance.IsDisabled;
                // return;
                // }
                Assert.IsTrue(false, "Impossible");
            }
        }