This template is used to paste properties compatible with the iEditable interface.
- Create a new smart paste template
- Set the match with property to:
[code language="VB.NET"]%ws1%%Accessibility%?%SharedModifier1%?%FieldVarPrefix1%%PartialIdentifier1%%mws%%As1%%Type1%(%ws2%?=%ws3%?%IdentifierStringOrNumber%)? %EndOfLineComment%?[/code]
- Set the replacement text to the following
[code language="VB.NET"]
Public Property %SharedModifier1% %PartialIdentifier1% %As1% %Type1%
Get
Return «Marker(60)»%FieldVarPrefix1%%PartialIdentifier1%
End Get
Set
«Cursor»If Not %FieldVarPrefix1%%PartialIdentifier1%.Equals(Value) Then
If Me.InEdit Then
SaveState("%PartialIdentifier1%", %FieldVarPrefix1%%PartialIdentifier1%, value)
End If
%FieldVarPrefix1%%PartialIdentifier1% = Value
OnPropertyChanged("%PartialIdentifier1%")
End If«BlockAnchor»
End Set
End Property [/code]
- Set the rest of the properties the same as Property(PrefixedField)
Example:
[code language="VB.NET"]
Private _id As String
Private _name As String
Private _salary As Decimal
Public Property id() As String
Get
Return _id
End Get
Set(ByVal value As String)
If Not _id.Equals(Value) Then
If Me.InEdit Then
SaveState("id", _id, value)
End If
_id = Value
OnPropertyChanged("id")
End If
End Set
End Property
Public Property name() As String
Get
Return _name
End Get
Set(ByVal value As String)
If Not _name.Equals(Value) Then
If Me.InEdit Then
SaveState("name", _name, value)
End If
_name = Value
OnPropertyChanged("name")
End If
End Set
End Property
Public Property salary() As Decimal
Get
Return _salary
End Get
Set(ByVal value As Decimal)
If Not _salary.Equals(Value) Then
If Me.InEdit Then
SaveState("salary", _salary, value)
End If
_salary = Value
OnPropertyChanged("salary")
End If
End Set
End Property
[/code]