120 lines
2.6 KiB
VB.net
120 lines
2.6 KiB
VB.net
Imports EgtWPFLib5
|
|
|
|
Public Class SceneButtonVM
|
|
|
|
Private m_TopListBtn As New List(Of ScenaBtn)
|
|
Public Property TopListBtn As List(Of ScenaBtn)
|
|
Get
|
|
Return m_TopListBtn
|
|
End Get
|
|
Set(value As List(Of ScenaBtn))
|
|
m_TopListBtn = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_LeftListBtn As New List(Of ScenaBtn)
|
|
Public Property LeftListBtn As List(Of ScenaBtn)
|
|
Get
|
|
Return m_LeftListBtn
|
|
End Get
|
|
Set(value As List(Of ScenaBtn))
|
|
m_LeftListBtn = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_RightListBtn As New List(Of ScenaBtn)
|
|
Public Property RightListBtn As List(Of ScenaBtn)
|
|
Get
|
|
Return m_RightListBtn
|
|
End Get
|
|
Set(value As List(Of ScenaBtn))
|
|
m_RightListBtn = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_BottomListBtn As New List(Of ScenaBtn)
|
|
Public Property BottomListBtn As List(Of ScenaBtn)
|
|
Get
|
|
Return m_BottomListBtn
|
|
End Get
|
|
Set(value As List(Of ScenaBtn))
|
|
m_BottomListBtn = value
|
|
End Set
|
|
End Property
|
|
|
|
Sub New()
|
|
Dim Index As Integer = 1
|
|
Dim sBtnString As String = String.Empty
|
|
While GetMainPrivateProfileString("LeftListBtn", "Btn_" & Index.ToString, "", sBtnString) > 0
|
|
m_TopListBtn.Add(New ScenaBtn(0, "Btn 1", "Img 1"))
|
|
Index = Index + 1
|
|
sBtnString = String.Empty
|
|
End While
|
|
End Sub
|
|
|
|
End Class
|
|
|
|
Public Class ScenaBtn
|
|
|
|
Private m_Type As Integer
|
|
Public Property Type As Integer
|
|
Get
|
|
Return m_Type
|
|
End Get
|
|
Set(value As Integer)
|
|
m_Type = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_Name As String
|
|
Public Property Name As String
|
|
Get
|
|
Return m_Name
|
|
End Get
|
|
Set(value As String)
|
|
m_Name = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_Img As String
|
|
Public Property Img As String
|
|
Get
|
|
Return m_Img
|
|
End Get
|
|
Set(value As String)
|
|
m_Img = value
|
|
End Set
|
|
End Property
|
|
|
|
Sub New(_Type As Integer, _Name As String, _Img As String)
|
|
m_Type = _Type
|
|
m_Name = _Name
|
|
m_Img = _Img
|
|
End Sub
|
|
|
|
Private m_CmdBtn As ICommand
|
|
Public ReadOnly Property CmdBtn As ICommand
|
|
Get
|
|
If m_CmdBtn Is Nothing Then
|
|
m_CmdBtn = New Command(AddressOf MethodBtn)
|
|
End If
|
|
Return m_CmdBtn
|
|
End Get
|
|
End Property
|
|
|
|
Private Sub MethodBtn()
|
|
SceneCmd.Exec(m_Name)
|
|
End Sub
|
|
|
|
End Class
|
|
|
|
Module SceneCmd
|
|
Public Sub Exec(Name)
|
|
Select Case Name
|
|
Case "Btn 1"
|
|
Dim x As Boolean = True
|
|
Case Else
|
|
Dim x As Boolean = False
|
|
End Select
|
|
End Sub
|
|
End Module |