123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- using Auth.Models;
- using Avalonia.Media;
- using Avalonia.Styling;
- using ReactiveUI;
- using System;
- using System.Drawing;
- using System.Security.Cryptography.X509Certificates;
- using Avalonia.Controls;
- using Avalonia.Controls.Shapes;
- using System.Linq;
- using Avalonia.Threading;
- using System.Runtime.CompilerServices;
- using Tmds.DBus.Protocol;
- using MsBox.Avalonia;
- using MsBox.Avalonia.Enums;
- namespace Auth.ViewModels
- {
- public class MainWindowViewModel : ViewModelBase
- {
- public UserControl _us = new Auth();
- public UserControl Us
- {
- get => _us;
- set => this.RaiseAndSetIfChanged(ref _us, value);
- }
-
- AuthVM _Auth = new AuthVM();
- public AuthVM Auth_VM
- {
- get => _Auth;
- set => _Auth = value;
- }
- CalcVM _Calc = new CalcVM();
- public CalcVM Calc_VM
- {
- get => _Calc;
- set => _Calc = value;
- }
- public void Knopka()
- {
- data data = new data();
- if (Auth_VM._login == data.login && Auth_VM._password == data.password)
- {
- Us = new Calc();
- }
- else
- {
- Auth_VM.changeMessage();
- Auth_VM.VisibleText = true;
- Auth_VM.Visible = false;
- Auth_VM.CreateCaptcha();
- }
- }
- int count = 0;
- public void ButtonPro()
- {
- if (Auth_VM.prov == Auth_VM.kod && Auth_VM._login == data.login && Auth_VM._password == data.password)
- {
- Us = new Calc();
- }
- else
- {
- Auth_VM.timer.Interval = new TimeSpan(0, 0, 10);
- Auth_VM.timer.Tick += new EventHandler(Auth_VM.timer_tick);
- count++;
- Auth_VM.Login = "";
- Auth_VM.Password = "";
- Auth_VM.CreateCaptcha();
- if (count == 1)
- {
- Auth_VM.changeMessage1();
- }
- if (count == 2)
- {
- Auth_VM.timer.Start();
- Auth_VM.Login = "";
- Auth_VM.Password = "";
- Auth_VM.changeMessage2();
- count = 0;
- Auth_VM.VisibleText = false;
- Auth_VM.Visible = true;
- Auth_VM.Enabled = false;
- }
- }
- }
- }
- }
|