public Boolean Display()
 {
     try
     {
         return(_soundSync.Display());
     }
     catch (Exception ex)
     {
         WinConsole.WriteLine(ex);
         return(false);
     }
 }
 public void Stop()
 {
     try
     {
         WinConsole.WriteLine("Stop");
         _soundSync.Stop();
     }
     catch (Exception ex)
     {
         WinConsole.WriteLine(ex);
     }
 }
 public void Pause()
 {
     try
     {
         WinConsole.WriteLine("Pause");
         _soundSync.Pause();
     }
     catch (Exception ex)
     {
         WinConsole.WriteLine(ex);
     }
 }
Esempio n. 4
0
        protected void Flash()
        {
            switch (flashing)
            {
            case WinConsoleFlashMode.FlashOnce:
                WinConsole.Flash(true);
                break;

            case WinConsoleFlashMode.FlashUntilResponse:
                WinConsole.Flash(false);
                break;
            }

            if (beep)
            {
                WinConsole.Beep();
            }
        }
        public void StartWCFServices()
        {
            var serviceAddress = Properties.Settings.Default.ServicesAddress.Replace("localhost", Environment.MachineName);

            WinConsole.WriteLine("Adresse SoundSync x86 server: " + serviceAddress);
            try
            {
                _serviceHost = new ServiceHost(typeof(SoundSyncx86Server));
                NetNamedPipeBinding binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
                _serviceHost.AddServiceEndpoint(typeof(ISoundSyncx86Interfaces), binding, serviceAddress);
                _serviceHost.Open();
            }

            catch (Exception ex)
            {
                WinConsole.WriteLine(ex);
                throw;
            }
        }
Esempio n. 6
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            // force current working directory to executable folder
            Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location));

            try
            {
                ProjectInstaller projectInstaller = new ProjectInstaller();
                Assembly         self             = Assembly.GetExecutingAssembly();
                String           ServiceName      = projectInstaller.Service.ServiceName;
                using (ServiceController serviceController = new ServiceController(ServiceName))
                {
                    WinConsole.Visible = true;

                    using (var services = new WindowsService())
                    {
                        services.StartWCFServices();

                        WinConsole.WriteLine(Properties.Resources.Quit);
                        WinConsole.Read();

                        services.StopWCFServices();
                    }
                }
            }
            catch (Exception ex)
            {
                if (Debugger.IsAttached == true)
                {
                    Console.WriteLine(ex.Message);
                    Console.WriteLine(Properties.Resources.PressKey);
                    Console.ReadKey();
                }
            }

            Environment.Exit(0);
        }