Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            ClientLineService service = new ClientLineService();

            DataTable dt = service.ReadLog();

            this.DataContext = dt.DefaultView;
        }
Ejemplo n.º 2
0
        public static void WriteLogAsync(MessageType messageType, string message, string trace)
        {
            ThreadPool.QueueUserWorkItem(o =>
            {
                try
                {
                    var assembly           = Assembly.GetExecutingAssembly().GetName();
                    string applicationName = string.Format("{0}.{1}.{2}.{3}", Environment.UserDomainName, Environment.MachineName,
                                                           assembly.Name, assembly.Version);
                    string userName          = Environment.UserName.ToUpper();
                    string stringMessageType = Enum.GetName(typeof(MessageType), messageType);

                    var service = new ClientLineService();
                    service.WriteLogAsync(DateTime.Now, applicationName, userName, "VisLab", stringMessageType, message, trace);
                }
                catch
                {
                }
            });
        }