Пример #1
0
 private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         var item = Adapter.GroupLogonList.FirstOrDefault(r => r.Name == this.称);
         if (item != null)
         {
             Adapter.GroupLogonList.Remove(item);
         }
     }
     else
     {
         var item = Adapter.GroupLogonList.FirstOrDefault(r => r.Name == this.称);
         if (item == null)
         {
             item = new GroupLogonInfo()
             {
                 Name = this.称
             };
             item.Times = e.Error.Message;
             Adapter.GroupLogonList.Add(item);
         }
         else
         {
             item.Times = e.Error.Message;
         }
     }
 }
Пример #2
0
        public void Start()
        {
            GroupLogonList = new List <GroupLogonInfo>();
            foreach (var item in GroupsDict.Values)
            {
                var o = new GroupLogonInfo()
                {
                    Name = item.称
                };
                GroupLogonList.Add(o);

                if (item.Safe启用)
                {
                    item.ClientID = -1;
                    item.Start();
                }
                else
                {
                    if (item.Status.Length > 0)
                    {
                        o.Times = item.Status;
                    }
                    //o.CanUse = false;
                }
            }
        }
Пример #3
0
        //public GroupClient.GroupService.QueryDataObj QueryInfoHK { get; set; }

        private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            switch (e.ProgressPercentage)
            {
            case 0:
                var status = e.UserState as string;
                var item   = Adapter.GroupLogonList.FirstOrDefault(r => r.Name == this.称);
                if (item == null)
                {
                    item        = new GroupLogonInfo();
                    item.Name   = this.称;
                    item.Times  = status;
                    item.CanUse = this.启用;
                    Adapter.GroupLogonList.Add(item);
                }
                else
                {
                    item.CanUse = this.启用;
                    item.Times  = status;
                }
                if (Regex.IsMatch(status, "[\u4e00-\u9fa5]+"))
                {
                    Status = status;
                }
                break;

            default:
                break;
            }
        }