Add project files.

This commit is contained in:
2023-08-07 09:18:08 +02:00
parent 7542685963
commit 1f39c39d96
10 changed files with 374 additions and 0 deletions

35
WinFormDi/MainWindow.cs Normal file
View File

@ -0,0 +1,35 @@
using DIDemoLib;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WinFormDi
{
public partial class MainWindow : Form
{
private readonly IMessages _messages;
public MainWindow(IMessages messages)
{
InitializeComponent();
_messages = messages;
}
private void MainWindow_Load(object sender, EventArgs e)
{
helloText.Text= _messages.SayHello();
}
private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
{
goodbyeText.Text= _messages.SayGoodBye();
MessageBox.Show("Closing...", "Warning", MessageBoxButtons.OK);
}
}
}