@@ -37,7 +37,6 @@ public frmCSMDH()
37
37
{
38
38
InitializeComponent ( ) ;
39
39
this . rootNode = null ;
40
- this . toolTip = null ;
41
40
this . treeLog . Sorted = true ;
42
41
this . dictGCID = new Dictionary < string , HashSet < string > > ( ) ;
43
42
@@ -68,6 +67,7 @@ public frmCSMDH()
68
67
this . listFilterNode . ListChanged += new ListChangedEventHandler ( listFilterNode_ListChanged ) ;
69
68
70
69
this . log_filename = @"C:\ProgramData\Mitel\Customer Service Manager\Server\Logs\TelDrv.log" ;
70
+
71
71
this . registryHandler = new RegistryHandler ( ) ;
72
72
73
73
this . waitHandle = new AutoResetEvent ( false ) ;
@@ -105,18 +105,23 @@ private void btnLogStart_Click(object sender, EventArgs e)
105
105
106
106
try
107
107
{
108
- if ( rbtnMCD . Checked )
108
+ if ( ( rbtnAuto . Checked &&
109
+ registryHandler . DriverVersion == enumDriverVersion . CP5000 ) ||
110
+ rbtnCP . Checked )
109
111
{
110
- logReader = new LogMCDReader ( log_filename , ! chkTailing . Checked ) ;
112
+ logReader = new LogCPReader ( log_filename , ! chkTailing . Checked ) ;
111
113
}
112
- else if ( rbtnCP . Checked )
114
+ else if ( ( rbtnAuto . Checked &&
115
+ ( registryHandler . DriverVersion == enumDriverVersion . MCD4x ||
116
+ registryHandler . DriverVersion == enumDriverVersion . MCD5x ) ) ||
117
+ rbtnMCD . Checked )
113
118
{
114
- logReader = new LogCPReader ( log_filename , ! chkTailing . Checked ) ;
119
+ logReader = new LogMCDReader ( log_filename , ! chkTailing . Checked ) ;
115
120
}
116
121
else
117
122
{
118
123
//TODO Fill this section
119
- logReader = new LogMCDReader ( log_filename , ! chkTailing . Checked ) ;
124
+ throw new Exception ( "The driver version should be checked!" ) ;
120
125
}
121
126
}
122
127
catch ( Exception ex )
@@ -511,7 +516,7 @@ private void treeLog_MouseDown(object sender, MouseEventArgs e)
511
516
{
512
517
if ( ModelingForm == null )
513
518
{
514
- if ( e . Button == MouseButtons . Right )
519
+ if ( e . Button == MouseButtons . Middle )
515
520
{
516
521
TreeNode node = treeLog . GetNodeAt ( e . X , e . Y ) ;
517
522
if ( node != null && node . Parent == null )
@@ -583,23 +588,20 @@ private void treeLog_MouseDown(object sender, MouseEventArgs e)
583
588
ModelingForm . AutoSize = true ;
584
589
ModelingForm . Show ( this ) ;
585
590
ModelingForm . ResumeLayout ( ) ;
586
- //CSMEvent tag = (CSMEvent)node.Tag;
587
- //string msgToolTip = String.Format("{0:4}Monitor: {1}", String.Empty, tag.eventInfo.MonitorHandlerExtension);
588
- //if (tag.eventInfo.CGCID != default(string))
589
- //{
590
- // msgToolTip += String.Format("{0}{1:4}CGCID: {2}", Environment.NewLine, String.Empty, tag.eventInfo.CGCID);
591
- //}
592
- //if (tag.eventInfo.PGCID != default(string))
593
- //{
594
- // msgToolTip += String.Format("{0}{1:4}PGCID: {2}", Environment.NewLine, String.Empty, tag.eventInfo.PGCID);
595
- //}
596
- //msgToolTip += String.Format("{0}{1}", Environment.NewLine, tag.eventInfo.Modeling);
597
- //toolTip = new ToolTip();
598
- //toolTip.ToolTipTitle = String.Format("Event: {0}", tag.eventInfo.Type);
599
- //toolTip.UseAnimation = false;
600
- //toolTip.UseFading = false;
601
- //toolTip.Show(msgToolTip, (IWin32Window)sender, e.X, e.Y);
602
- //treeLog.SelectedNode = node;
591
+ }
592
+ }
593
+ else if ( e . Button == MouseButtons . Right )
594
+ {
595
+ TreeNode node = treeLog . GetNodeAt ( e . X , e . Y ) ;
596
+ if ( node != null && node . Parent == null )
597
+ {
598
+ treeLog . SelectedNode = node ;
599
+ string result = ( node . Text + Environment . NewLine ) . TrimStart ( ) ;
600
+ foreach ( TreeNode inode in node . Nodes )
601
+ {
602
+ result += " " + inode . Text + Environment . NewLine ;
603
+ }
604
+ Clipboard . SetText ( result ) ;
603
605
}
604
606
}
605
607
}
@@ -612,10 +614,10 @@ private void treeLog_MouseDown(object sender, MouseEventArgs e)
612
614
613
615
private void treeLog_KeyDown ( object sender , KeyEventArgs e )
614
616
{
615
- if ( toolTip != null )
617
+ if ( ModelingForm != null )
616
618
{
617
- toolTip . Hide ( treeLog ) ;
618
- toolTip = null ;
619
+ ModelingForm . Close ( ) ;
620
+ ModelingForm = null ;
619
621
}
620
622
}
621
623
@@ -631,6 +633,18 @@ private void openLogFile(object sender, EventArgs e)
631
633
if ( dialog . ShowDialog ( ) == DialogResult . OK )
632
634
{
633
635
log_filename = dialog . FileName ;
636
+ if ( log_filename . Equals ( default_log_filename , StringComparison . CurrentCultureIgnoreCase ) )
637
+ {
638
+ rbtnAuto . Visible = true ;
639
+ rbtnMCD . Visible = false ;
640
+ rbtnCP . Visible = false ;
641
+ }
642
+ else
643
+ {
644
+ rbtnAuto . Visible = false ;
645
+ rbtnMCD . Visible = true ;
646
+ rbtnCP . Visible = true ;
647
+ }
634
648
this . btnLogStop_Click ( sender , e ) ;
635
649
}
636
650
}
@@ -657,22 +671,12 @@ private void updateVersionLabel()
657
671
658
672
private void button1_Click ( object sender , EventArgs e )
659
673
{
660
- //if (comboBox1.Text != String.Empty)
661
- //{
662
-
663
- //}
664
- //LibraryHandler libHandler = new LibraryHandler();
665
- //libHandler.UnregisterDll("TelCommon.dll");
666
- //libHandler.RegisterDll("TelCommon.dll");
667
674
if ( ModelingForm == null )
668
675
{
669
676
ModelingForm = new Form ( ) ;
670
677
ModelingForm . StartPosition = FormStartPosition . Manual ;
671
678
ModelingForm . Left = Cursor . Position . X + 5 ;
672
679
ModelingForm . Top = Cursor . Position . Y + 5 ;
673
- //ModelingForm.Width = 0;
674
- //ModelingForm.Height = 0;
675
- //ModelingForm.FormBorderStyle = FormBorderStyle.None;
676
680
ModelingForm . FormBorderStyle = FormBorderStyle . Sizable ;
677
681
ModelingForm . Name = "frmModeling" ;
678
682
ModelingForm . BackColor = System . Drawing . Color . LightGray ;
@@ -682,7 +686,6 @@ private void button1_Click(object sender, EventArgs e)
682
686
eee . Multiline = true ;
683
687
eee . ReadOnly = true ;
684
688
TabControl tbc = new TabControl ( ) ;
685
- //tbc.SizeMode = TabSizeMode.Fixed;
686
689
SplitContainer sc = new SplitContainer ( ) ;
687
690
TableLayoutPanel tbl = new TableLayoutPanel ( ) ;
688
691
Button b = new Button ( ) ;
@@ -709,8 +712,6 @@ private void button1_Click(object sender, EventArgs e)
709
712
sc . AutoSize = true ;
710
713
tbl2 . ResumeLayout ( ) ;
711
714
tbl . ResumeLayout ( ) ;
712
- //sc.Panel1.Size = PreferredSize;
713
- //sc.Panel2.Size = PreferredSize;
714
715
sc . BorderStyle = BorderStyle . Fixed3D ;
715
716
sc . AutoSize = true ;
716
717
string aaa = @"
0 commit comments