public async Task <bool> StartService(IProgressObject progress = null)
        {
            var disposeProgress = progress == null;
            var result          = false;

            try
            {
                progress = progress ?? this.GetProgressObject(String.Empty);

                // We need this one here in case the user stopped the service by other means
                if (InstanceType == InstanceType.ServiceControl && InMaintenanceMode)
                {
                    ServiceControlInstance.DisableMaintenanceMode();
                }
                progress.Report(new ProgressDetails("Starting Service"));
                await Task.Run(() => result = ServiceInstance.TryStartService());

                UpdateServiceProperties();

                return(result);
            }
            finally
            {
                if (disposeProgress)
                {
                    progress?.Dispose();
                }
            }
        }
        public async Task <bool> StopService(IProgressObject progress = null)
        {
            var disposeProgress = progress == null;
            var result          = false;

            try
            {
                progress = progress ?? this.GetProgressObject(String.Empty);

                progress.Report(new ProgressDetails("Stopping Service"));
                await Task.Run(() =>
                {
                    result = ServiceControlInstance.TryStopService();
                    if (InMaintenanceMode)
                    {
                        ServiceControlInstance.DisableMaintenanceMode();
                    }
                });

                UpdateServiceProperties();

                return(result);
            }
            finally
            {
                if (disposeProgress)
                {
                    progress.Dispose();
                }
            }
        }