123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Shapes;
- using System.Windows.Threading;
- namespace HotelCalifornia
- {
- /// <summary>
- /// Логика взаимодействия для Client.xaml
- /// </summary>
- public partial class Client : Window
- {
- public Client()
- {
- InitializeComponent();
- DispatcherTimer timer = new DispatcherTimer();
- timer.Tick += new EventHandler(Update_Timer_Tick);
- timer.Interval = new TimeSpan(0, 0, 1);
- timer.Start();
- }
- private void Update_Timer_Tick(object sender, EventArgs e)
- {
- timetxt.Text = DateTime.Now.ToString();
- }
- //Перетаскивание окна
- private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
- {
- DragMove();
- }
- //Возврат к окну выбора функции
- private void Back(object sender, RoutedEventArgs e)
- {
- MessageBoxResult result = MessageBox.Show("Вы хотите вернуться к предыдущему окну?", "Предупреждение", MessageBoxButton.YesNo, MessageBoxImage.Question);
- switch (result)
- {
- case MessageBoxResult.Yes:
- Variant variant = new Variant();
- this.Close();
- variant.Show();
- break;
- case MessageBoxResult.No:
- break;
- }
- }
- //Выход из приложения
- private void Close(object sender, RoutedEventArgs e)
- {
- MessageBoxResult result = MessageBox.Show("Вы хотите выйти из приложения?", "Предупреждение", MessageBoxButton.YesNo, MessageBoxImage.Question);
- switch (result)
- {
- case MessageBoxResult.Yes:
- Application.Current.Shutdown();
- break;
- case MessageBoxResult.No:
- break;
- }
- }
- private void WindMin_Click(object sender, RoutedEventArgs e)
- {
- this.WindowState = WindowState.Minimized;
- }
- }
- }
|