Esempio n. 1
0
        private void Device_Mc(string name, int type, Soft cr, int isclick)
        {
            switch (type)
            {
            case 0:    //主机设置
                HideDevicePanel();
                AddComputerSetting();
                break;

            case 1:    //权限设置
                if (1 == isclick)
                {
                    HideDevicePanel();
                    AddAuthoritySetting(cr);
                }
                break;

            case 2:               //语音设置
                if (1 == isclick) //点击而不是拖动
                {
                    HideDevicePanel();
                    AddCommunicationSetting();
                }
                break;

            default: break;
            }
        }
Esempio n. 2
0
 private void St_Kii(Soft cr, int type)
 {
     if (1 == type)//显示配置属性
     {
         if (cr.SoftName.Equals("Pilot"))
         {
             Mc.Invoke(DeviceName, 1, cr, type);
         }
         else if (cr.SoftName.Equals("Radar"))
         {
             Mc.Invoke(DeviceName, 2, cr, type);
         }
     }
     else
     {
         if (cr.SoftName == "Coach")
         {
             move_contrl = cr;
         }
         else if (null == Group.global_soft.Find(op => op.Devicename.Equals(cr.Devicename) && op.SoftName.Equals(cr.SoftName)))
         {
             move_contrl = cr;
         }
     }
 }
Esempio n. 3
0
        public void AddSoft(string name, Image img)
        {
            Soft st = new Soft();

            st.Kii       += St_Kii;
            st.Devicename = label_DeviceName.Text;
            st.SetSoftName(name);
            st.SetSoftImage(img);
            flowLayoutPanel1.Controls.Add(st);
        }
Esempio n. 4
0
 public void SetSoftImage(string name, Image img)
 {
     foreach (var v in flowLayoutPanel1.Controls)
     {
         Soft t = (Soft)v;
         if (t.SoftName.Equals(name))
         {
             t.SetSoftImage(img);
         }
     }
 }
Esempio n. 5
0
 //鼠标进入显示 鼠标离开时隐藏
 private void St_Hint(Soft st)
 {
     if (null != st)//显示
     {
         panel4.Visible  = true;
         panel4.Location = st.Location;//new Point(st.Location.X, st.Location.Y - panel4.Height);
         SetMsg(st.SoftName, st.Devicename);
     }
     else//隐藏
     {
         panel4.Visible = false;
     }
 }
Esempio n. 6
0
        private bool IsInclueSoft(string softname, Soft st)
        {
            bool success = false;

            foreach (var v in flowLayoutPanel1.Controls)
            {
                if (((Soft)v).SoftName.Equals(softname) && ((Soft)v).Devicename.Equals(st.Devicename))
                {
                    success = true;
                    break;
                }
            }
            return(success);
        }
Esempio n. 7
0
 public void AddSoft(string name, Image img, Soft stl)
 {
     if (!IsInclueSoft(name, stl))
     {
         Soft st = new Soft();
         st.Kii       += St_Kii;
         st.Hint      += St_Hint;
         st.Devicename = stl.Devicename;
         st.SetSoftName(name);
         st.SetSoftImage(img);
         st.GroupNumb = GroupNumb;
         flowLayoutPanel1.Controls.Add(st);
     }
 }
Esempio n. 8
0
        public Soft IsIncludeSoft(string devicename, string softname)
        {
            Soft st = null;

            foreach (var v in flowLayoutPanel1.Controls)
            {
                Soft temp = (Soft)v;
                if (temp.Devicename == devicename && temp.SoftName == softname)
                {
                    st = temp;
                    break;
                }
            }
            return(st);
        }
Esempio n. 9
0
        //在线分组
        private void OnLineGroup(Dictionary <ServiceReference1.TrainPlan, List <ServiceReference1.RoleUserRelation> > ur, Dictionary <string, string[]> online)
        {
            string path = Directory.GetCurrentDirectory();

            if (null != ur && 0 < ur.Count)
            {
                foreach (var v in ur)
                {
                    var gg = fm_Traingroup.IsIncludeGroup(v.Key.trainPlanGroupID);
                    if (null == gg)//添加组
                    {
                        int index = v.Key.trainPlanGroupID.IndexOf("Group");
                        if (index == -1)
                        {
                            index = v.Key.trainPlanGroupID.IndexOf("p");
                        }
                        string numb = v.Key.trainPlanGroupID.Substring(index + 1, v.Key.trainPlanGroupID.Length - index - 1);
                        int    k    = 0;
                        if (numb.Length > 0)
                        {
                            k = Convert.ToInt32(numb);
                        }
                        fm_Traingroup.AddGroup("Group" + k.ToString(), k);
                        gg = fm_Traingroup.IsIncludeGroup(v.Key.trainPlanGroupID);
                    }
                    for (int j = 0; j < v.Value.Count; j++)//添加软件图标
                    {
                        //var on=online.Values.Where(o)
                        Soft st = new Soft();
                        st.Devicename = v.Value[j].user;
                        var image = Image.FromFile(String.Format(path + "\\resource\\客户端掉线在线图标\\{0}-{1}.png", (j + 1).ToString(), (j + 1).ToString()));
                        gg.AddSoft(v.Value[j].role, image, st);
                    }
                    //设置按钮状态
                    gg.DataSync(v.Key);
                }
            }
            //分组数量
            if (ur.Count != beforegroupnumber)
            {
                fm_GroupSeting.SetGroupNum(ur.Count);
            }
            beforegroupnumber = ur.Count;
        }
Esempio n. 10
0
 //移除组成员
 public void RemoveGroupItem(Soft soft)
 {
     foreach (var c in flowLayoutPanel1.Controls)
     {
         Soft st = (Soft)c;
         if (st.Devicename == soft.Devicename && st.SoftName == soft.SoftName)
         {
             Form_Main.service.removeUserToTrainningGroupAsync(soft.SoftName, soft.Devicename, GroupName);
             //int k= global_soft.RemoveAll(o => o.Devicename.Equals(soft.Devicename) && o.SoftName.Equals(soft.SoftName));
             int index = global_soft.FindIndex(o => o.Devicename == soft.Devicename && o.SoftName == soft.SoftName);
             if (index != -1)
             {
                 global_soft.RemoveAt(index);
             }
             flowLayoutPanel1.Controls.Remove(st);
             break;
         }
     }
 }
Esempio n. 11
0
 public void AddAuthoritySetting(Soft st)
 {
     if (!panel1.Controls.Contains(authoritySetting))
     {
         authoritySetting.NTPF += AuthoritySetting_NTPF;
         authoritySetting.Dock  = DockStyle.Fill;
         authoritySetting.InitUi();
         authoritySetting.SetGroupSelectIndex(st.GroupNumb - 1);
         authoritySetting.SetSoft(st);
         authoritySetting.ReadAuthority("Group" + st.GroupNumb.ToString());
         panel1.Controls.Add(authoritySetting);
     }
     else
     {
         authoritySetting.InitUi();
         authoritySetting.SetGroupSelectIndex(st.GroupNumb - 1);
         authoritySetting.SetSoft(st);
         authoritySetting.ReadAuthority("Group" + st.GroupNumb.ToString());
         authoritySetting.Show();
     }
 }
Esempio n. 12
0
        //拖动完成时
        private void St_Kii(Control cr, int type)
        {
            var soft = (Soft)cr;

            if (0 == type)//拖动完成时
            {
                McGroup.Invoke(GroupName, soft);
                //设置标记
                var v = global_soft.FindAll(o => o.Devicename == soft.Devicename && o.SoftName == soft.SoftName);
                if (v.Count == 1)
                {
                    v.FirstOrDefault().ShowGroupTag(false);
                }
                //移除当前客户端图标
                flowLayoutPanel1.Controls.Remove(soft);
                Form_Main.service.removeUserToTrainningGroupAsync(soft.SoftName, soft.Devicename, GroupName);
                //int k= global_soft.RemoveAll(o => o.Devicename.Equals(soft.Devicename) && o.SoftName.Equals(soft.SoftName));
                int index = global_soft.FindIndex(o => o.Devicename == soft.Devicename && o.SoftName == soft.SoftName);
                if (index != -1)
                {
                    global_soft.RemoveAt(index);
                }
            }
            else//单击时显示设置界面
            {
                current_soft = soft;

                if (label_Load.Image.Tag != null)
                {
                    Soft v = global_soft.Find(o => o.Devicename.Equals(soft.Devicename) && o.SoftName.Equals(soft.SoftName));
                    if (null != v)
                    {
                        v.GroupNumb = GroupNumb;
                        v.ShowForm(v, 1);
                    }
                }
            }
        }
Esempio n. 13
0
 public void AddSoft(Soft st)
 {
     flowLayoutPanel1.Controls.Add(st);
 }
Esempio n. 14
0
 public void SetSoft(Soft st)
 {
     soft = st;
 }
Esempio n. 15
0
 public void AddSoft(Soft cl)
 {
     flowLayoutPanel1.Controls.Add(cl);
 }
Esempio n. 16
0
 //查找是否存在一个教员在多个分组里
 private int GetGlobalSoftCoachCount(Soft st)
 {
     return(global_soft.Where(o => o.SoftName == st.SoftName && o.Devicename == st.Devicename).Count());
 }
Esempio n. 17
0
 //显示配置属性
 public void ShowForm(Soft st, int type)
 {
     Kii.Invoke(st, type);
 }