Browse Source

Solved: listview issue

master
노호영 5 years ago
parent
commit
74b7970659
  1. BIN
      .vs/MacManagerForTemPatch/v16/.suo
  2. 23
      Form1.Designer.cs
  3. 56
      Form1.cs
  4. BIN
      bin/Debug/MacManagerForTemPatch.exe
  5. BIN
      bin/Debug/MacManagerForTemPatch.pdb
  6. BIN
      obj/Debug/MacManagerForTemPatch.csproj.GenerateResource.cache
  7. BIN
      obj/Debug/MacManagerForTemPatch.csprojAssemblyReference.cache
  8. BIN
      obj/Debug/MacManagerForTemPatch.exe
  9. BIN
      obj/Debug/MacManagerForTemPatch.pdb

BIN
.vs/MacManagerForTemPatch/v16/.suo

Binary file not shown.

23
Form1.Designer.cs

@ -40,10 +40,10 @@ namespace MacManagerForTemPatch
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.button_add_test = new System.Windows.Forms.Button();
this.button_removeAll = new System.Windows.Forms.Button();
this.button_save_csv = new System.Windows.Forms.Button();
this.serialPort = new System.IO.Ports.SerialPort(this.components);
this.button_add_test = new System.Windows.Forms.Button();
this.label_lastmac = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
@ -140,6 +140,16 @@ namespace MacManagerForTemPatch
this.groupBox2.TabStop = false;
this.groupBox2.Text = "관리";
//
// button_add_test
//
this.button_add_test.Location = new System.Drawing.Point(564, 173);
this.button_add_test.Name = "button_add_test";
this.button_add_test.Size = new System.Drawing.Size(79, 40);
this.button_add_test.TabIndex = 4;
this.button_add_test.Text = "Test";
this.button_add_test.UseVisualStyleBackColor = true;
this.button_add_test.Click += new System.EventHandler(this.button_add_test_Click);
//
// button_removeAll
//
this.button_removeAll.Location = new System.Drawing.Point(564, 20);
@ -160,17 +170,6 @@ namespace MacManagerForTemPatch
this.button_save_csv.UseVisualStyleBackColor = true;
this.button_save_csv.Click += new System.EventHandler(this.button_save_csv_Click);
//
// button_add_test
//
this.button_add_test.Location = new System.Drawing.Point(564, 173);
this.button_add_test.Name = "button_add_test";
this.button_add_test.Size = new System.Drawing.Size(79, 40);
this.button_add_test.TabIndex = 4;
this.button_add_test.Text = "Test";
this.button_add_test.UseVisualStyleBackColor = true;
this.button_add_test.Visible = false;
this.button_add_test.Click += new System.EventHandler(this.button_add_test_Click);
//
// label_lastmac
//
this.label_lastmac.AutoSize = true;

56
Form1.cs

@ -7,6 +7,7 @@ using System.Drawing;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@ -30,7 +31,7 @@ namespace MacManagerForTemPatch
{
InitializeComponent();
runTimeData = new StringCollection();
comboBox_comport.DataSource = SerialPort.GetPortNames();
//comboBox_comport.DataSource = SerialPort.GetPortNames();
mSerial_Buff = new byte[4096];
mSerial_Buff_idx = 0;
@ -70,10 +71,61 @@ namespace MacManagerForTemPatch
}
}
GetSerialPort();
}
private void GetSerialPort()
{
// comboBox_comport.DataSource = SerialPort.GetPortNames();
comboBox_comport.Items.Clear();
try
{
foreach (string str in SerialPort.GetPortNames())
{
comboBox_comport.Items.Add(str);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
protected override void WndProc(ref Message m)
{
UInt32 WM_DEVICECHANGE = 0x0219;
UInt32 DBT_DEVTUP_VOLUME = 0x02;
UInt32 DBT_DEVICEARRIVAL = 0x8000;
UInt32 DBT_DEVICEREMOVECOMPLETE = 0x8004;
if ((m.Msg == WM_DEVICECHANGE) && (m.WParam.ToInt32() == DBT_DEVICEARRIVAL))//디바이스 연결
{
//int m_Count = 0;
int devType = Marshal.ReadInt32(m.LParam, 4);
if (devType == DBT_DEVTUP_VOLUME)
{
GetSerialPort();
}
}
if ((m.Msg == WM_DEVICECHANGE) && (m.WParam.ToInt32() == DBT_DEVICEREMOVECOMPLETE)) //디바이스 연결 해제
{
int devType = Marshal.ReadInt32(m.LParam, 4);
if (devType == DBT_DEVTUP_VOLUME)
{
GetSerialPort();
}
}
base.WndProc(ref m);
}
private void button_save_csv_Click(object sender, EventArgs e)
{
string fileName;
@ -273,7 +325,7 @@ namespace MacManagerForTemPatch
if (MessageBox.Show("저장이 완료되었습니다. 목록을 삭제할까요? ", "데이터 삭제", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
macList.Clear();
listView.Clear();
listView_maclist.Items.Clear();
Properties.Settings.Default.savedmaclist.Clear();
Properties.Settings.Default.Save();

BIN
bin/Debug/MacManagerForTemPatch.exe

Binary file not shown.

BIN
bin/Debug/MacManagerForTemPatch.pdb

Binary file not shown.

BIN
obj/Debug/MacManagerForTemPatch.csproj.GenerateResource.cache

Binary file not shown.

BIN
obj/Debug/MacManagerForTemPatch.csprojAssemblyReference.cache

Binary file not shown.

BIN
obj/Debug/MacManagerForTemPatch.exe

Binary file not shown.

BIN
obj/Debug/MacManagerForTemPatch.pdb

Binary file not shown.
Loading…
Cancel
Save