Exemplo n.º 1
0
        public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args)
        {
            if (Filter != null && !Filter.ShouldTrace(eventCache, source, eventType, id, format, args, null, null))
            {
                return;
            }

            string idDescription;

            if (source == "ExcelDna.Integration")
            {
                // For this source, we interpret the event id as a grouping
                IntegrationTraceEventId traceEventId = (IntegrationTraceEventId)id;
                idDescription = traceEventId.ToString();
            }
            else
            {
                idDescription = id.ToString(CultureInfo.InvariantCulture);
            }
            string header = string.Format(CultureInfo.InvariantCulture, "{0} [{1}] ", idDescription, eventType.ToString());

            base.TraceEvent(eventCache, source, eventType, id, header + format, args);

            if (eventType == TraceEventType.Error || eventType == TraceEventType.Critical)
            {
                LogDisplay.Show();
            }
        }
Exemplo n.º 2
0
        private void btnCopy_Click(object sender, EventArgs e)
        {
            string allText = LogDisplay.GetAllText();

            if (!string.IsNullOrEmpty(allText))
            {
                Clipboard.SetText(allText);
            }
        }
Exemplo n.º 3
0
        private void btnCopy_Click(object sender, EventArgs e)
        {
            string allText = LogDisplay.GetAllText();

            if (allText != null)
            {
                Clipboard.SetText(allText);
            }
        }
Exemplo n.º 4
0
 public override void WriteLine(string message)
 {
     try
     {
         LogDisplay.RecordLine(message);
     }
     catch (Exception e)
     {
         Debug.Print("LogDisplayTraceListener error: " + e.Message);
     }
 }
Exemplo n.º 5
0
        private void btnSaveErrors_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.DefaultExt = "txt";
            sfd.Filter     = "Text File (*.txt)|*.txt|All Files (*.*)|*.*";
            sfd.Title      = "Save Error List As";
            DialogResult result = sfd.ShowDialog();

            if (result == DialogResult.OK)
            {
                File.WriteAllText(sfd.FileName, LogDisplay.GetAllText());
            }
        }
Exemplo n.º 6
0
 private void btnClear_Click(object sender, EventArgs e)
 {
     LogDisplay.Clear();
     Clear();
 }
 public override void Show()
 {
     LogDisplay.Show();
 }
 public override void Clear()
 {
     LogDisplay.Clear();
 }
 public override void RecordLine(string format, params object[] args)
 {
     LogDisplay.RecordLine(format, args);
 }
 public override void WriteLine(string format, params object[] args)
 {
     LogDisplay.WriteLine(format, args);
 }
 public override void SetText(string text)
 {
     LogDisplay.SetText(text);
 }
 public override void Hide()
 {
     LogDisplay.Hide();
 }