Example #1
0
        /// <summary>
        /// Called by Rhino when the user wants to run the command.
        /// </summary>
        protected override Result RunCommand(RhinoDoc doc, RunMode mode)
        {
            if (!RockfishServerPlugIn.CheckForAdministrator())
            {
                return(Result.Cancel);
            }

            var service = RockfishServiceHost.TheServiceHost;

            if (service.IsRunning)
            {
                RhinoApp.WriteLine("Rockfish service already running.");
                return(Result.Success);
            }

            // Start the service
            var rc = service.Start();

            if (rc)
            {
                // Start the activity log (if not disabled)
                RockfishLog.TheLog.Start();
            }

            return(rc ? Result.Success : Result.Failure);
        }
Example #2
0
        /// <summary>
        /// Called by Rhino when the user wants to run the command.
        /// </summary>
        protected override Result RunCommand(RhinoDoc doc, RunMode mode)
        {
            if (!RockfishServerPlugIn.CheckForAdministrator())
            {
                return(Result.Cancel);
            }

            // Stop the activity log
            RockfishLog.TheLog.Stop();

            // Stop the service
            RockfishServiceHost.TheServiceHost.Stop();

            return(Result.Success);
        }