Ejemplo n.º 1
0
        protected override void OnStart(string[] args)
        {
            try
            {
                MyConsole.Clear();
                MyConsole.WriteLine();
                var version   = Assembly.GetExecutingAssembly().GetName().Version.ToString();
                var buildDate = ApplicationInformation.CompileDate;
                MyConsole.WriteLine("Servicio TPpagoL2 v{0}", version);
                MyConsole.WriteLine("Generado el {0}", buildDate.ToString("dd-MM-yyyy HH:mm:ss"));
                log.InfoFormat("Servicio TPpagoL2 v{0} Generado el {1}", version, buildDate.ToString("dd-MM-yyyy HH:mm:ss"));
                MyConsole.WriteLine(new string('-', 50));
                MyConsole.WriteLine("PARÁMETROS");
                MyConsole.WriteLine(" Nombre Pipe         : " + Settings.Default.NombrePipe);
                MyConsole.WriteLine(" Puerto COM Máquinas : " + Settings.Default.PuertoMaquinasEfectivo);
                MyConsole.WriteLine(" Puerto COM Arduino  : " + Settings.Default.PuertoArduino);
                MyConsole.WriteLine(new string('-', 50));

                timerStartService = new System.Threading.Timer(StartService, null, 0, System.Threading.Timeout.Infinite);
            }
            catch (Exception ex)
            {
                MyConsole.WriteLine("*** ERROR: {0}", ex.Message);
                EventLog.Source = "TPpagoL2";
                EventLog.WriteEntry("Service TPpagoL2 shutdown unexpectedly --> " + ex.ToString(), EventLogEntryType.Error);
                OnStop();
            }
        }
 public static void Clear(CharAttribute attributes = DefaultAttributes)
 {
     MyConsole.Clear(attributes);
 }
Ejemplo n.º 3
0
 private StringBuilder ClearConsole(MyCommandArgs args)
 {
     MyConsole.Clear();
     return(new StringBuilder("Console cleared..."));
 }