コード例 #1
0
ファイル: FrmAstxRecFrwdForm.cs プロジェクト: tanxulong/MUAC
 private void checkBoxF1_CheckedChanged(object sender, EventArgs e)
 {
     if (this.checkBoxF1.Checked == true)
     {
         if (RecForwConnection1.StartForward(
                 //Source parameters (always passed in, however the connection manager will use it just in the case the
                 // connection is not active already)
                 IPAddress.Parse(this.listBoxLocalAddr.Items[0].ToString()),
                 IPAddress.Parse(this.listBoxIPAddress.Items[0].ToString()),
                 int.Parse(this.listBoxPort.Items[0].ToString()),
                 // Forward parameters
                 IPAddress.Parse(this.listBoxForwardingInterface.Items[0].ToString()),
                 IPAddress.Parse(this.listBoxForwardingMulticast.Items[0].ToString()),
                 int.Parse(this.listBoxForwardingPort.Items[0].ToString())) == false)
         {
             this.checkBoxF1.Checked = false;
         }
         else
         {
             this.progressBarF1.Visible = true;
         }
     }
     else
     {
         RecForwConnection1.StopForwarding();
         this.progressBarF1.Visible = false;
     }
 }
コード例 #2
0
ファイル: FrmAstxRecFrwdForm.cs プロジェクト: tanxulong/MUAC
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (RecForwConnection1.IsRecordingEnabled() == true || RecForwConnection1.IsForwardingEnabled() == true)
     {
         this.labelBytes1.Text = RecForwConnection1.GetBytesProcessed().ToString();
     }
     if (RecForwConnection2.IsRecordingEnabled() == true || RecForwConnection2.IsForwardingEnabled() == true)
     {
         this.labelBytes2.Text = RecForwConnection2.GetBytesProcessed().ToString();
     }
     if (RecForwConnection3.IsRecordingEnabled() == true || RecForwConnection3.IsForwardingEnabled() == true)
     {
         this.labelBytes3.Text = RecForwConnection3.GetBytesProcessed().ToString();
     }
     if (RecForwConnection4.IsRecordingEnabled() == true || RecForwConnection4.IsForwardingEnabled() == true)
     {
         this.labelBytes4.Text = RecForwConnection4.GetBytesProcessed().ToString();
     }
     if (RecForwConnection5.IsRecordingEnabled() == true || RecForwConnection5.IsForwardingEnabled() == true)
     {
         this.labelBytes5.Text = RecForwConnection5.GetBytesProcessed().ToString();
     }
 }
コード例 #3
0
ファイル: FrmAstxRecFrwdForm.cs プロジェクト: tanxulong/MUAC
        private void checkedListBoxRecordingName_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            // Check if this item is checked
            if (e.NewValue == CheckState.Checked)
            {
                AppendDateTime DateTimeAppend = new AppendDateTime();
                string         path_and_name  = this.textBoxRecordDirectory.Text + "\\" + DateTimeAppend.ApendDateandTimeToFront(this.checkedListBoxRecordingName.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString());

                switch (this.checkedListBoxRecordingName.SelectedIndex)
                {
                case 0:
                    if (RecForwConnection1.IsRecordingEnabled() == false)
                    {
                        if (RecForwConnection1.StartRecording(!this.chkBoxReplayFormatEnabled1.Checked,
                                                              path_and_name + GetFileExtension(!this.chkBoxReplayFormatEnabled1.Checked),
                                                              IPAddress.Parse(this.listBoxLocalAddr.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString()),
                                                              IPAddress.Parse(this.listBoxIPAddress.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString()),
                                                              int.Parse(this.listBoxPort.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString())) == false)
                        {
                            this.checkedListBoxRecordingName.SetItemCheckState(this.checkedListBoxRecordingName.SelectedIndex, CheckState.Unchecked);
                        }
                        else
                        {
                            progressBar1.Visible = true;
                            this.chkBoxReplayFormatEnabled1.Enabled = false;
                        }
                    }
                    break;

                case 1:
                    if (RecForwConnection2.IsRecordingEnabled() == false)
                    {
                        if (RecForwConnection2.StartRecording(!this.chkBoxReplayFormatEnabled2.Checked,
                                                              path_and_name + GetFileExtension(!this.chkBoxReplayFormatEnabled2.Checked),
                                                              IPAddress.Parse(this.listBoxLocalAddr.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString()),
                                                              IPAddress.Parse(this.listBoxIPAddress.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString()),
                                                              int.Parse(this.listBoxPort.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString())) == false)
                        {
                            this.checkedListBoxRecordingName.SetItemCheckState(this.checkedListBoxRecordingName.SelectedIndex, CheckState.Unchecked);
                        }
                        else
                        {
                            progressBar2.Visible = true;
                            this.chkBoxReplayFormatEnabled2.Enabled = false;
                        }
                    }
                    break;

                case 2:
                    if (RecForwConnection3.IsRecordingEnabled() == false)
                    {
                        if (RecForwConnection3.StartRecording(!this.chkBoxReplayFormatEnabled3.Checked,
                                                              path_and_name + GetFileExtension(!this.chkBoxReplayFormatEnabled3.Checked),
                                                              IPAddress.Parse(this.listBoxLocalAddr.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString()),
                                                              IPAddress.Parse(this.listBoxIPAddress.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString()),
                                                              int.Parse(this.listBoxPort.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString())) == false)
                        {
                            this.checkedListBoxRecordingName.SetItemCheckState(this.checkedListBoxRecordingName.SelectedIndex, CheckState.Unchecked);
                        }
                        else
                        {
                            progressBar3.Visible = true;
                            this.chkBoxReplayFormatEnabled3.Enabled = false;
                        }
                    }
                    break;

                case 3:
                    if (RecForwConnection4.IsRecordingEnabled() == false)
                    {
                        if (RecForwConnection4.StartRecording(!this.chkBoxReplayFormatEnabled4.Checked,
                                                              path_and_name + GetFileExtension(!this.chkBoxReplayFormatEnabled4.Checked),
                                                              IPAddress.Parse(this.listBoxLocalAddr.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString()),
                                                              IPAddress.Parse(this.listBoxIPAddress.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString()),
                                                              int.Parse(this.listBoxPort.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString())) == false)
                        {
                            this.checkedListBoxRecordingName.SetItemCheckState(this.checkedListBoxRecordingName.SelectedIndex, CheckState.Unchecked);
                        }
                        else
                        {
                            progressBar4.Visible = true;
                            this.chkBoxReplayFormatEnabled4.Enabled = false;
                        }
                    }
                    break;

                case 4:
                    if (RecForwConnection5.IsRecordingEnabled() == false)
                    {
                        if (RecForwConnection5.StartRecording(!this.chkBoxReplayFormatEnabled5.Checked,
                                                              path_and_name + GetFileExtension(!this.chkBoxReplayFormatEnabled5.Checked),
                                                              IPAddress.Parse(this.listBoxLocalAddr.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString()),
                                                              IPAddress.Parse(this.listBoxIPAddress.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString()),
                                                              int.Parse(this.listBoxPort.Items[this.checkedListBoxRecordingName.SelectedIndex].ToString())) == false)
                        {
                            this.checkedListBoxRecordingName.SetItemCheckState(this.checkedListBoxRecordingName.SelectedIndex, CheckState.Unchecked);
                        }
                        else
                        {
                            progressBar5.Visible = true;
                            this.chkBoxReplayFormatEnabled5.Enabled = false;
                        }
                    }
                    break;

                default:
                    break;
                }
            }
            else // No it is not checked
            {
                switch (this.checkedListBoxRecordingName.SelectedIndex)
                {
                case 0:
                    if (RecForwConnection1.IsRecordingEnabled() == true)
                    {
                        RecForwConnection1.StopRecording();
                        progressBar1.Visible = false;
                        this.chkBoxReplayFormatEnabled1.Enabled = true;
                    }
                    break;

                case 1:
                    if (RecForwConnection2.IsRecordingEnabled() == true)
                    {
                        RecForwConnection2.StopRecording();
                        progressBar2.Visible = false;
                        this.chkBoxReplayFormatEnabled2.Enabled = true;
                    }
                    break;

                case 2:
                    if (RecForwConnection3.IsRecordingEnabled() == true)
                    {
                        RecForwConnection3.StopRecording();
                        progressBar3.Visible = false;
                        this.chkBoxReplayFormatEnabled3.Enabled = true;
                    }
                    break;

                case 3:
                    if (RecForwConnection4.IsRecordingEnabled() == true)
                    {
                        RecForwConnection4.StopRecording();
                        progressBar4.Visible = false;
                        this.chkBoxReplayFormatEnabled4.Enabled = true;
                    }
                    break;

                case 4:
                    if (RecForwConnection5.IsRecordingEnabled() == true)
                    {
                        RecForwConnection5.StopRecording();
                        progressBar5.Visible = false;
                        this.chkBoxReplayFormatEnabled5.Enabled = true;
                    }
                    break;

                default:
                    break;
                }
            }
        }