예제 #1
0
        private static void ExecuteProcess(ProcessCommand command)
        {
            string error;

            using (Process process = Process.Start(StorageEmulatorProcessFactory.Create(command)))
            {
                Stopwatch sw = new Stopwatch();
                sw.Start();
                if (process == null)
                {
                    throw new InvalidOperationException("Unable to start process.");
                }

                error = GetError(process);

                while (!GetStatus(process) || sw.ElapsedMilliseconds > 30000)
                {
                    ".".Write();
                    Thread.Sleep(500);
                }
            }

            if (!String.IsNullOrEmpty(error))
            {
                throw new InvalidOperationException(error);
            }
        }
예제 #2
0
    public static bool IsProcessRunning()
    {
        bool status;

        using (Process process = Process.Start(StorageEmulatorProcessFactory.Create(ProcessCommand.Status)))
        {
            if (process == null)
            {
                throw new InvalidOperationException("Unable to start process.");
            }
            status = GetStatus(process);
            process.WaitForExit();
        }
        return(status);
    }
        private static void ExecuteProcess(ProcessCommand command)
        {
            string error;

            using (Process process = Process.Start(StorageEmulatorProcessFactory.Create(command)))
            {
                if (process == null)
                {
                    return;
                }

                error = GetError(process);
                process.WaitForExit();
            }
        }
예제 #4
0
    private static void ExecuteProcess(ProcessCommand command)
    {
        string error;

        using (Process process = Process.Start(StorageEmulatorProcessFactory.Create(command)))
        {
            if (process == null)
            {
                throw new InvalidOperationException("Unable to start process.");
            }
            error = GetError(process);
            process.WaitForExit();
        }
        if (!String.IsNullOrEmpty(error))
        {
            throw new InvalidOperationException(error);
        }
    }
        public static bool IsProcessRunning()
        {
            try
            {
                bool status;

                using (Process process = Process.Start(StorageEmulatorProcessFactory.Create(ProcessCommand.Status)))
                {
                    if (process == null)
                    {
                        return(false);
                    }

                    status = GetStatus(process);
                    process.WaitForExit();
                }

                return(status);
            }
            catch
            {
                return(false);
            }
        }