Пример #1
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            if (group == null)
            {
                MessageBox.Show("Сначала выберите группу");
                return;
            }
            wndInitPointConfig cnfg;
            int max_per_min;

            if (group.AgentTemplateList != null && group.AgentTemplateList.Count > 0 && group.AgentTemplateList[0].Type != typeof(HumanAgent).Name)
            {
                max_per_min = 5;
            }
            else
            {
                max_per_min = 180;
            }
            if (group != null && group.AgentDistribution != null)
            {
                cnfg = new wndInitPointConfig(group.AgentDistribution.ToArray(), max_per_min);
            }
            else
            {
                cnfg = new wndInitPointConfig(max_per_min);
            }
            if (cnfg.ShowDialog().GetValueOrDefault())
            {
                group.AgentDistribution = cnfg.InitPointDistribution;
            }
        }
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     if (group == null)
     {
         MessageBox.Show("Сначала выберите группу");
         return;
     }
     wndInitPointConfig cnfg;
     int max_per_min;
     if (group.AgentTemplateList != null && group.AgentTemplateList.Count > 0 && group.AgentTemplateList[0].Type != typeof(HumanAgent).Name)
     {
         max_per_min = 5;
     }
     else
     {
         max_per_min = 180;
     }
     if (group!=null && group.AgentDistribution!=null)
     {
         cnfg = new wndInitPointConfig(group.AgentDistribution.ToArray(), max_per_min);
     }
     else
     {
         cnfg = new wndInitPointConfig(max_per_min);
     }
     if (cnfg.ShowDialog().GetValueOrDefault())
     {
         group.AgentDistribution = cnfg.InitPointDistribution;
     }
 }