Пример #1
0
 void DoUpdateTaskEmployees(TokenEdit edit, Task task)
 {
     task.ClearEmployees();
     foreach (int id in (IList)edit.EditValue)
     {
         Employee emp = EmployeesRegistry.GetEmployee(id);
         task.AddEmployee(emp);
     }
 }
Пример #2
0
        protected IList <Task> LoadTasks()
        {
            List <Task> list = new List <Task>();

            for (int i = 0; i < 20; i++)
            {
                Task task = new Task(string.Format("Task {0}", i.ToString()));
                for (int n = 0; n < 3; n++)
                {
                    int id = rd.Next(0, EmployeesRegistry.EmployeeCount);
                    task.AddEmployee(EmployeesRegistry.GetEmployee(id));
                }
                list.Add(task);
            }
            return(list);
        }
Пример #3
0
        protected RepositoryItemTokenEdit CreateRep()
        {
            RepositoryItemTokenEdit rep = new RepositoryItemTokenEdit();

            rep.BeginInit();
            rep.Tokens.BeginUpdate();
            rep.SelectedItemsChanged += OnTokenEditSelectedItemsChanged;
            rep.AutoHeightMode        = TokenEditAutoHeightMode.RestrictedExpand;
            rep.MaxExpandLines        = 1;
            try {
                rep.Name          = "rep";
                rep.EditValueType = TokenEditValueType.List;
                gridControl.RepositoryItems.Add(rep);
                foreach (Employee emp in EmployeesRegistry.GetEmployees())
                {
                    rep.Tokens.AddToken(emp.Name, emp.GetId());
                }
            }
            finally {
                rep.Tokens.EndUpdate();
                rep.EndInit();
            }
            return(rep);
        }