Projektdateien hinzufügen.
This commit is contained in:
1 parent
176212b9d6
commit
838d5a110d
33 files changed
+2585
No files matched your search
@@ -0,0 +1,14 @@
|
||||
Public Class General
|
||||
|
||||
Shared _settings As Settings
|
||||
|
||||
Public Shared ReadOnly Property Settings As Settings
|
||||
Get
|
||||
If _settings Is Nothing Then
|
||||
_settings = New Settings
|
||||
End If
|
||||
Return _settings
|
||||
End Get
|
||||
End Property
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,28 @@
|
||||
Imports DevExpress.XtraEditors
|
||||
Imports DevExpress.XtraGrid
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
|
||||
Public Class GridFunctions
|
||||
Public Shared Function CreateFormatRule(ByRef grdv As GridView, Column As String, ApplyToRow As Boolean, Condition As DevExpress.XtraEditors.FormatCondition, value1 As Object, Optional value2 As Object = Nothing, Optional backcolor As Color = Nothing, Optional fontstyle As FontStyle = Nothing) As GridFormatRule
|
||||
Dim rule As New GridFormatRule
|
||||
rule.Column = grdv.Columns(Column)
|
||||
rule.ApplyToRow = ApplyToRow
|
||||
rule.Rule = New FormatConditionRuleValue With {
|
||||
.Condition = Condition,
|
||||
.Value1 = value1,
|
||||
.Value2 = value2
|
||||
}
|
||||
If backcolor <> Nothing Then rule.RuleCast(Of FormatConditionRuleValue).Appearance.BackColor = backcolor
|
||||
If fontstyle <> Nothing Then rule.RuleCast(Of FormatConditionRuleValue).Appearance.FontStyleDelta = fontstyle
|
||||
|
||||
Return rule
|
||||
End Function
|
||||
|
||||
Public Shared Sub EndGridEdit(grdv As DevExpress.XtraGrid.Views.Grid.GridView)
|
||||
If grdv.FocusedRowHandle <> DevExpress.XtraGrid.GridControl.NewItemRowHandle Then
|
||||
grdv.CloseEditor()
|
||||
grdv.UpdateCurrentRow()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,27 @@
|
||||
Imports Newtonsoft.Json
|
||||
Public Class Settings
|
||||
|
||||
Public Property Categories As List(Of Category)
|
||||
|
||||
Public Sub New()
|
||||
Load()
|
||||
End Sub
|
||||
|
||||
Private Sub Load()
|
||||
If My.Settings.CategoryList IsNot Nothing AndAlso My.Settings.CategoryList.Trim.Length > 0 Then
|
||||
Try
|
||||
Categories = JsonConvert.DeserializeObject(Of List(Of Category))(My.Settings.CategoryList)
|
||||
Catch ex As Exception
|
||||
Categories = New List(Of Category)
|
||||
End Try
|
||||
Else
|
||||
Categories = New List(Of Category)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub Save()
|
||||
My.Settings.CategoryList = JsonConvert.SerializeObject(Categories)
|
||||
My.Settings.Save()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in new issue
Block a user