123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- 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 PracticaDemoexam.Model;
- using PracticaDemoexam.Model.ItemModels;
- using PracticaDemoexam.Windows;
- namespace PracticaDemoexam.Windows
- {
- /// <summary>
- /// Логика взаимодействия для PriorityChanger.xaml
- /// </summary>
- public partial class PriorityChanger : Window
- {
- public List<AgentModel> SelectedAgents;
- private void SetPriority()
- {
- int ret = 0;
- foreach (AgentModel am in SelectedAgents)
- {
- if(am.Agent.Priority > ret)
- {
- ret = am.Agent.Priority;
- }
- }
- tbPrior.Text = ret.ToString();
- }
-
- public PriorityChanger(List<AgentModel> ls)
- {
- InitializeComponent();
- SelectedAgents = ls;
- this.Loaded += PriorityChanger_Loaded;
- }
- private void PriorityChanger_Loaded(object sender, RoutedEventArgs e)
- {
- SetPriority();
- }
- public Action<List<AgentModel>, int> Button_click;
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- Button_click.Invoke(SelectedAgents, Convert.ToInt32(tbPrior.Text));
- }
- }
- }
|