Common.cs 740 字节
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DeviceLibrary
{
    class Common
    {
    }
    public class Msg
    {
        public static List<Msg> msg = new List<Msg>(); 
        public string msgtxt;
        public MsgLevel msgLevel;
        public DateTime datetime;

        public static List<Msg> get() {
            return msg;
        }
        public static void add(string m, MsgLevel ml)
        {
            msg.Add(new Msg { msgtxt = m, msgLevel = ml, datetime=DateTime.Now });
        }
        public static void clear()
        {
            msg.Clear();
        }
    }
    public enum MsgLevel {

        warning,
        info
    }
}