Example #1
0
 static void Restart()
 {
     using (var service = new WindowsService("MSDTC"))
     {
         service.Restart();
     }
 }
Example #2
0
 public void Start()
 {
     using (var service = new WindowsService("MSMQ"))
     {
         service.Start();
     }
 }
Example #3
0
		public void VerifyRunning(bool allowStart)
		{
			using (var service = new WindowsService("MSDTC"))
			{
				bool running = service.IsRunning();
				if (running)
					return;

				if (!allowStart)
					throw new InvalidOperationException("The MSDTC is not running and allowStart was not specified.");

				service.Start();
			}
		}
Example #4
0
        public void VerifyRunning(bool allowStart)
        {
            using (var service = new WindowsService("MSDTC"))
            {
                bool running = service.IsRunning();
                if (running)
                {
                    return;
                }

                if (!allowStart)
                {
                    throw new InvalidOperationException("The MSDTC is not running and allowStart was not specified.");
                }

                service.Start();
            }
        }
Example #5
0
		public void Start()
		{
			using(var service = new WindowsService("MSMQ"))
			{
				service.Start();
			}
		}
Example #6
0
		static void Restart()
		{
			using (var service = new WindowsService("MSDTC"))
			{
				service.Restart();
			}
		}