hytos / DTI_PID / SPPIDConverter / MThread.vb @ d45df999
이력 | 보기 | 이력해설 | 다운로드 (3.99 KB)
1 | 6ba3e887 | Gyusu | |
---|---|---|---|
2 | Imports System.Threading |
||
3 | |||
4 | |||
5 | Module MThread |
||
6 | '@brief Listview Get Delegate |
||
7 | '@author : Gyusu Park |
||
8 | '@date : 2018-04-09 |
||
9 | '@history: |
||
10 | Public Delegate Function GetListViewDelegate(ByVal oListView As ListView) As List(Of String) |
||
11 | |||
12 | '@brief Listview control(load) Invoke |
||
13 | '@author : Gyusu Park |
||
14 | '@date : 2018-04-09 |
||
15 | '@history: |
||
16 | Public Function GetListViewItems(ByVal oListView As ListView) As List(Of String) |
||
17 | ' Return the list back To the Delegate |
||
18 | Dim pathList = New List(Of String) |
||
19 | For Each item As ListViewItem In oListView.Items |
||
20 | If item.Checked Then |
||
21 | pathList.Add(item.Text) |
||
22 | End If |
||
23 | Next |
||
24 | Return pathList |
||
25 | End Function |
||
26 | '@brief Progressbar Input Delegate |
||
27 | '@author : Gyusu Park |
||
28 | '@date : 2018-04-09 |
||
29 | '@history: |
||
30 | Public Delegate Sub SetProgressBarDelegate(ByVal oProgressBar As ToolStripProgressBar, ByVal dValue As Double) |
||
31 | |||
32 | '@brief Progressbar control Invoke |
||
33 | '@author : Gyusu Park |
||
34 | '@date : 2018-04-09 |
||
35 | '@history: |
||
36 | Public Sub SetProgressbar(ByVal oProgressBar As ToolStripProgressBar, ByVal dValue As Double) |
||
37 | Try |
||
38 | If oProgressBar.GetCurrentParent.InvokeRequired Then |
||
39 | oProgressBar.GetCurrentParent.Invoke(New SetProgressBarDelegate(AddressOf SetProgressbar), oProgressBar, dValue) |
||
40 | Else |
||
41 | If dValue >= 100 Then |
||
42 | oProgressBar.Value = 99 |
||
43 | Else |
||
44 | oProgressBar.Value = dValue |
||
45 | End If |
||
46 | |||
47 | oProgressBar.GetCurrentParent.Refresh() |
||
48 | End If |
||
49 | Catch ex As Exception |
||
50 | |||
51 | End Try |
||
52 | |||
53 | |||
54 | End Sub |
||
55 | |||
56 | '@brief Listview Add Delegate |
||
57 | '@author : Gyusu Park |
||
58 | '@date : 2018-04-10 |
||
59 | '@history: |
||
60 | Public Delegate Sub SetListBoxItemDelegate(ByVal oListbox As ListBox, ByVal sValue As String) |
||
61 | |||
62 | '@brief Listview control(add) Invoke |
||
63 | '@author : Gyusu Park |
||
64 | '@date : 2018-04-10 |
||
65 | '@history: |
||
66 | Public Sub SetListBoxItems(ByVal oListbox As ListBox, ByVal sValue As String) |
||
67 | Try |
||
68 | If oListbox.InvokeRequired Then |
||
69 | oListbox.Invoke(New SetListBoxItemDelegate(AddressOf SetListBoxItems), oListbox, sValue) |
||
70 | Else |
||
71 | |||
72 | oListbox.Items.Add(sValue) |
||
73 | oListbox.SelectedIndex = oListbox.Items.Count - 1 |
||
74 | End If |
||
75 | Catch ex As Exception |
||
76 | |||
77 | End Try |
||
78 | |||
79 | End Sub |
||
80 | |||
81 | Public Sub SetProgressValue(ByVal sTextBox As ToolStripLabel, ByVal sValue As String) |
||
82 | |||
83 | End Sub |
||
84 | '@brief Gridview Add Delegate |
||
85 | '@author : Gyusu Park |
||
86 | '@date : 2018-04-10 |
||
87 | '@history: |
||
88 | Public Delegate Sub SetGridViewDelegate(ByVal oDataGrid As DataGrid, ByVal oDt As DataTable) |
||
89 | |||
90 | '@brief Gridview control(add) Invoke |
||
91 | '@author : Gyusu Park |
||
92 | '@date : 2018-04-10 |
||
93 | '@history: |
||
94 | Public Sub SetGridViewInvoke(ByVal oDataGrid As DataGrid, ByVal oDt As DataTable) |
||
95 | If oDataGrid.InvokeRequired Then |
||
96 | oDataGrid.Invoke(New SetGridViewDelegate(AddressOf SetGridViewInvoke), oDataGrid, oDt) |
||
97 | Else |
||
98 | oDataGrid.DataSource = oDt |
||
99 | End If |
||
100 | End Sub |
||
101 | |||
102 | '@brief TreeView Add Delegate |
||
103 | '@author : Gyusu Park |
||
104 | '@date : 2018-04-10 |
||
105 | '@history: |
||
106 | Public Delegate Function SetTreeViewDelegate(ByVal oTreeView As TreeView, ByVal oNodeCollection As TreeNodeCollection, ByVal sNodeKey As String, ByVal sNodeName As String) As TreeNode |
||
107 | |||
108 | '@brief TreeView control(add) Invoke |
||
109 | '@author : Gyusu Park |
||
110 | '@date : 2018-04-10 |
||
111 | '@history: |
||
112 | Public Function SetTreeViewItems(ByVal oTreeView As TreeView, ByVal oNodeCollection As TreeNodeCollection, ByVal sNodeKey As String, ByVal sNodeName As String) As TreeNode |
||
113 | Dim oResultNode As New TreeNode |
||
114 | If oTreeView.InvokeRequired Then |
||
115 | oTreeView.Invoke(New SetTreeViewDelegate(AddressOf SetTreeViewItems), oTreeView, oNodeCollection, sNodeKey, sNodeName) |
||
116 | Else |
||
117 | Return oNodeCollection.Add(sNodeKey, sNodeName) |
||
118 | End If |
||
119 | Return oResultNode |
||
120 | End Function |
||
121 | End Module |