Exemple #1
0
        public void InternalLog(string source, ConsoleLogType logType = ConsoleLogType.Log)
        {
            var para = new HTMLParagraphElement()
            {
                className = "console-para"
            };

            switch (logType)
            {
            case ConsoleLogType.Debug:
                para.style.color = Color.ForestGreen;
                break;

            case ConsoleLogType.Error:
                para.style.color = Color.Red;
                break;
            }

            para.innerHTML = source;
            logContent.appendChild(para);
            if (logContent.children.length > 1000)
            {
                logContent.removeChild(logContent.children[0]);
            }
            para.scrollIntoView(false);
        }
Exemple #2
0
 public static void showNotifyInfo(string info, ConsoleLogType t = ConsoleLogType.Publish)
 {
     try
     {
         if (ConsoleLogType.Debug == t)
         {
             return;
         }
         SetConsoleColor(ConsoleColor.DarkGreen);
         Console.WriteLine(System.DateTime.Now.ToString("HH:mm:ss") + ":" + info);
         SetConsoleColor(ConsoleColor.Gray);
     }
     catch
     { }
 }
Exemple #3
0
    static void Main(string[] args)
    {
        ILogType consolelogType = new ConsoleLogType();

        Email e1 = new Email()
        {
            From = "Me", To = "Vasya", Theme = "Who are you?"
        };
        Email e2 = new Email()
        {
            From = "Vasya", To = "Me", Theme = "vacuum cleaners!"
        };
        Email e3 = new Email()
        {
            From = "Kolya", To = "Vasya", Theme = "No! Thanks!"
        };
        Email e4 = new Email()
        {
            From = "Vasya", To = "Me", Theme = "washing machines!"
        };
        Email e5 = new Email()
        {
            From = "Me", To = "Vasya", Theme = "Yes"
        };
        Email e6 = new Email()
        {
            From = "Vasya", To = "Petya", Theme = "+2"
        };

        EmailSender es = new EmailSender();

        es.Send(e1, consolelogType);
        es.Send(e2, consolelogType);
        es.Send(e3, consolelogType);
        es.Send(e4, consolelogType);
        es.Send(e5, consolelogType);
        es.Send(e6, consolelogType);

        Console.ReadKey();
    }
Exemple #4
0
 public static void Log(string source, ConsoleLogType logType = ConsoleLogType.Log)
 {
     CheckConsoleState();
     _consoleForm.InternalLog(source, logType);
 }