Пример #1
0
        private void DetectPrimaryAction()
        {
            // Check if FlexSearch is installed as a service
            if (!Helpers.DoesServiceExist("FlexSearch-Server"))
            {
                this.MainMessage          = NotService;
                this.ActionsSelectedIndex = 0;
                return;
            }


            var service = Helpers.GetService("FlexSearch-Server");

            if (service.Status != ServiceControllerStatus.Running)
            {
                this.MainMessage          = "FlexSearch Server is installed as a service, but the service is not running.";
                this.ActionsSelectedIndex = 2;
            }
            else
            {
                this.MainMessage          = "FlexSearch Server is installed as a service and the service is running correctly.";
                this.ActionsSelectedIndex = 3;
            }
        }
Пример #2
0
 private void TaskRegisteration()
 {
     this.Actions.Add(new Tuple <string, System.Action>("Install Windows Service", Tasks.InstallServerTask));
     this.Actions.Add(new Tuple <string, System.Action>("Un-install Windows Service", Tasks.UnInstallServerTask));
     this.Actions.Add(new Tuple <string, System.Action>("Start Service", Tasks.StartServerTask));
     this.Actions.Add(new Tuple <string, System.Action>("Stop Service", Tasks.StopServiceTask));
     this.Actions.Add(new Tuple <string, System.Action>("Open Event Viewer", () => Helpers.Exec("eventvwr.exe", "")));
     this.Actions.Add(new Tuple <string, System.Action>("Open Services", () => Helpers.Exec("mmc.exe", "services.msc")));
     this.Actions.Add(new Tuple <string, System.Action>("Explore", () => Helpers.Exec("explorer.exe", Helpers.BasePath)));
     this.Actions.Add(new Tuple <string, System.Action>("Settings", () => Helpers.Exec("explorer.exe", Path.Combine(Helpers.BasePath, "Conf"))));
     this.Actions.Add(new Tuple <string, System.Action>("About", () => Helpers.Exec("http://flexsearch.net", "", true)));
     this.Actions.Add(new Tuple <string, System.Action>("Exit", () => Application.Current.Shutdown()));
 }