small code refactoring
This commit is contained in:
@@ -1,76 +1,74 @@
|
||||
using System;
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
using Telerik.WinControls.UI;
|
||||
|
||||
namespace Pilz.Updating.Administration.GUI
|
||||
namespace Pilz.Updating.Administration.GUI;
|
||||
|
||||
public partial class ApplicationVersionInput
|
||||
{
|
||||
public partial class ApplicationVersionInput
|
||||
|
||||
// C o n s t r u c t o r s
|
||||
|
||||
public ApplicationVersionInput()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// C o n s t r u c t o r s
|
||||
// Init Channel-ComboBox
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_Stable, Tag = Channels.Stable });
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_PreRelease, Tag = Channels.PreRelease });
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_Beta, Tag = Channels.Beta });
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_Alpha, Tag = Channels.Alpha });
|
||||
radDropDownList_Channel.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
public ApplicationVersionInput()
|
||||
// P r o p e r t i e s
|
||||
|
||||
public Version Version
|
||||
{
|
||||
get
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// Init Channel-ComboBox
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_Stable, Tag = Channels.Stable });
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_PreRelease, Tag = Channels.PreRelease });
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_Beta, Tag = Channels.Beta });
|
||||
radDropDownList_Channel.Items.Add(new RadListDataItem() { Text = My.Resources.UpdatingAdministrationLangRes.Channel_Alpha, Tag = Channels.Alpha });
|
||||
radDropDownList_Channel.SelectedIndex = 0;
|
||||
return new Version(radTextBoxControl_Version.Text.Trim());
|
||||
}
|
||||
|
||||
// P r o p e r t i e s
|
||||
|
||||
public Version Version
|
||||
set
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Version(radTextBoxControl_Version.Text.Trim());
|
||||
}
|
||||
radTextBoxControl_Version.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
radTextBoxControl_Version.Text = value.ToString();
|
||||
}
|
||||
public Channels Channel
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Channels)radDropDownList_Channel.SelectedItem.Tag;
|
||||
}
|
||||
|
||||
public Channels Channel
|
||||
set
|
||||
{
|
||||
get
|
||||
foreach (var ci in radDropDownList_Channel.Items)
|
||||
{
|
||||
return (Channels)radDropDownList_Channel.SelectedItem.Tag;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
foreach (var ci in radDropDownList_Channel.Items)
|
||||
if ((Channels)ci.Tag == value)
|
||||
{
|
||||
if ((Channels)ci.Tag == value)
|
||||
{
|
||||
radDropDownList_Channel.SelectedItem = ci;
|
||||
}
|
||||
radDropDownList_Channel.SelectedItem = ci;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int Build
|
||||
public int Build
|
||||
{
|
||||
get
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)Math.Round(radSpinEditor_Build.Value);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
radSpinEditor_Build.Value = value;
|
||||
}
|
||||
return (int)Math.Round(radSpinEditor_Build.Value);
|
||||
}
|
||||
|
||||
private void radButton_Accept_Click(object sender, EventArgs e)
|
||||
set
|
||||
{
|
||||
|
||||
radSpinEditor_Build.Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
private void radButton_Accept_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user