Exemplo n.º 1
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TracePropertiesForm tpf = new TracePropertiesForm();

            tpf.StartPosition = FormStartPosition.CenterScreen;

            if (tpf.ShowDialog() == DialogResult.OK)
            {
                if (!permission(tpf))
                {
                    System.Windows.Forms.MessageBox.Show(string.Format("'{0}' has no correct permission.", tpf.Username),
                                                         "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    Trace trace = _traceManager.RunProfiler(tpf.ServerName, tpf.Username, tpf.Password, tpf.TraceName, tpf.RawConn, tpf.EventProperties, tpf.FilterProperties);

                    TraceViewControl tvc = new TraceViewControl();
                    tvc.Name  = "TraceViewControl";
                    tvc.Trace = trace;
                    tvc.Dock  = DockStyle.Fill;

                    FATabStripItem item = new FATabStripItem(tvc);
                    item.Title = tpf.TraceName;
                    tabStrip.AddTab(item, true);

                    tabStrip.Enabled = true;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the current trace.
        /// </summary>
        /// <returns></returns>
        /// <value>The current trace.</value>
        private Trace GetCurrentTrace()
        {
            if (tabStrip.SelectedItem == null)
            {
                return(null);
            }

            TraceViewControl tvc = tabStrip.SelectedItem.Controls["TraceViewControl"] as TraceViewControl;

            if (tvc == null)
            {
                return(null);
            }

            return(tvc.Trace);
        }
Exemplo n.º 3
0
        private void SetCurrentTrace(Trace trace)
        {
            if (tabStrip.SelectedItem == null)
            {
                return;
            }

            TraceViewControl tvc = tabStrip.SelectedItem.Controls["TraceViewControl"] as TraceViewControl;

            if (tvc == null)
            {
                return;
            }

            tvc.Trace    = trace;
            CurrentTrace = trace;
        }
Exemplo n.º 4
0
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            foreach (FATabStripItem item in tabStrip.Items)
            {
                TraceViewControl tvc = item.Controls[0] as TraceViewControl;
                if (tvc != null)
                {
                    Trace trace = tvc.Trace;
                    trace.Profiler.Stop();
                    trace.Profiler.Close();

                    if (trace != null)
                    {
                        _traceManager.DeleteProfiler(trace.Profiler);
                    }
                    trace = null;
                }
            }
            Settings.Default.Save();
            UpdatesChecker.NewVersionIsAvailable += UpdatesChecker_NewVersionIsAvailable;
        }