-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathEditAttribute.vb
More file actions
108 lines (88 loc) · 3.82 KB
/
EditAttribute.vb
File metadata and controls
108 lines (88 loc) · 3.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
Imports System.Windows.Forms
<System.Runtime.InteropServices.ComVisible(False)> Public Class EditAttribute
'Public Sub New()
' ' This call is required by the designer.
' InitializeComponent()
' ' Add any initialization after the InitializeComponent() call.
' ' Set "String" as the initial default type.
' cboAttributeType.Text = "String"
'End Sub
Public Property AttributeName() As String
Get
Return Me.txtAttributeName.Text
End Get
Set(ByVal value As String)
Me.txtAttributeName.Text = value
End Set
End Property
Public Property AttributeValue() As String
Get
Return Me.txtAttributeValue.Text
End Get
Set(ByVal value As String)
Me.txtAttributeValue.Text = value
End Set
End Property
Public Property AttributeType() As Inventor.ValueTypeEnum
Get
Select Case cboAttributeType.SelectedIndex
Case 0
Return Inventor.ValueTypeEnum.kStringType
Case 1
Return Inventor.ValueTypeEnum.kIntegerType
Case 2
Return Inventor.ValueTypeEnum.kDoubleType
Case 3
Return Inventor.ValueTypeEnum.kByteArrayType
End Select
End Get
Set(ByVal value As Inventor.ValueTypeEnum)
Select Case value
Case Inventor.ValueTypeEnum.kStringType
cboAttributeType.Text = "String"
Case Inventor.ValueTypeEnum.kIntegerType
cboAttributeType.Text = "Integer"
Case Inventor.ValueTypeEnum.kDoubleType
cboAttributeType.Text = "Double"
Case Inventor.ValueTypeEnum.kByteArrayType
cboAttributeType.Text = "Byte Array"
End Select
End Set
End Property
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
Me.DialogResult = System.Windows.Forms.DialogResult.OK
Me.Close()
End Sub
Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Close()
End Sub
Public WriteOnly Property EditMode() As Boolean
Set(ByVal value As Boolean)
If value = True Then
Me.Text = "Edit Attribute"
Me.cboAttributeType.Enabled = False
Else
Me.Text = "Create Attribute"
Me.txtAttributeName.Text = ""
Me.txtAttributeValue.Text = ""
Me.cboAttributeType.Text = "String"
Me.cboAttributeType.Enabled = True
End If
End Set
End Property
Private Sub EditAttribute_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
End Sub
Private Sub EditAttribute_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
If Me.Text = "Create Attribute" Then
Me.txtAttributeName.Focus()
Me.txtAttributeName.SelectAll()
End If
End Sub
Private Sub EditAttribute_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
End Sub
Private Sub EditAttribute_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
End Sub
Private Sub cboAttributeType_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboAttributeType.SelectedIndexChanged
End Sub
End Class