small code refactoring

This commit is contained in:
Schedel Pascal
2024-06-19 08:10:16 +02:00
parent 20770bed31
commit c9216ac79b
93 changed files with 2753 additions and 5835 deletions

View File

@@ -1,62 +1,60 @@
using System;
using Microsoft.VisualBasic.CompilerServices;
using Telerik.WinControls.UI;
namespace Pilz.Updating.Administration.GUI
namespace Pilz.Updating.Administration.GUI;
public partial class PackageDescriptionEditor
{
public partial class PackageDescriptionEditor
// C o n s t r u c t o r s
public PackageDescriptionEditor()
{
InitializeComponent();
// C o n s t r u c t o r s
public PackageDescriptionEditor()
radDropDownList_Formatting.Items.AddRange(new RadListDataItem[]
{
InitializeComponent();
new() { Text = "Nur Text", Tag = UpdateNotesContentType.PlainText },
new() { Text = "Markdown", Tag = UpdateNotesContentType.Markdown },
new() { Text = "HTML", Tag = UpdateNotesContentType.HTML },
});
}
radDropDownList_Formatting.Items.AddRange(new RadListDataItem[]
{
new RadListDataItem { Text = "Nur Text", Tag = UpdateNotesContentType.PlainText },
new RadListDataItem { Text = "Markdown", Tag = UpdateNotesContentType.Markdown },
new RadListDataItem { Text = "HTML", Tag = UpdateNotesContentType.HTML },
});
// P r o p e r t i e s
public string Titel
{
get
{
return radTextBoxControl_Titel.Text;
}
// P r o p e r t i e s
public string Titel
set
{
get
{
return radTextBoxControl_Titel.Text;
}
set
{
radTextBoxControl_Titel.Text = value;
}
radTextBoxControl_Titel.Text = value;
}
}
public string Description
public string Description
{
get
{
get
{
return radTextBox_Description.Text;
}
set
{
radTextBox_Description.Text = value ?? String.Empty;
}
return radTextBox_Description.Text;
}
public UpdateNotesContentType DescriptionType
set
{
get =>
(UpdateNotesContentType)radDropDownList_Formatting.SelectedItem?.Tag;
set
{
foreach (var item in radDropDownList_Formatting.Items)
if ((UpdateNotesContentType)item.Tag == value)
radDropDownList_Formatting.SelectedItem = item;
}
radTextBox_Description.Text = value ?? String.Empty;
}
}
public UpdateNotesContentType DescriptionType
{
get =>
(UpdateNotesContentType)radDropDownList_Formatting.SelectedItem?.Tag;
set
{
foreach (var item in radDropDownList_Formatting.Items)
if ((UpdateNotesContentType)item.Tag == value)
radDropDownList_Formatting.SelectedItem = item;
}
}
}