Push project
This commit is contained in:
37
TextSort/Window.cs
Normal file
37
TextSort/Window.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using TextSortWindow;
|
||||
|
||||
namespace TextSort
|
||||
{
|
||||
public partial class Window : Form, ISortWindow
|
||||
{
|
||||
public string InputText => InputTextBox.Text;
|
||||
public string SelectedStrategy => SortAlgorithmComboBox.SelectedItem?.ToString() ?? "";
|
||||
public event EventHandler? SortButtonClicked;
|
||||
|
||||
public Window()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void DisplaySortedText(string sortedText)
|
||||
{
|
||||
OutputLabel.Text = sortedText;
|
||||
}
|
||||
|
||||
public void DisplayTime(double milliseconds)
|
||||
{
|
||||
TimeLabel.Text = $"{milliseconds} ms";
|
||||
}
|
||||
|
||||
public void SetSortOptions(List<string> options)
|
||||
{
|
||||
SortAlgorithmComboBox.DataSource = options;
|
||||
}
|
||||
|
||||
private void SortButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
SortButtonClicked?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user