示例#1
0
        public UserTaskGroup GetTaskGroup(int groupId)
        {
            UserTaskGroup group = null;

            TaskGroups.TryGetValue(groupId, out group);
            return(group);
        }
示例#2
0
        public UserTaskGroup CreateTaskGroup(int groupId)
        {
            UserTaskGroup group = null;

            if (groupId >= 0)
            {
                group = GetTaskGroup(groupId);
                if (group == null)
                {
                    group = new UserTaskGroup(groupId);
                    TaskGroups[groupId] = group;
                }
            }
            return(group);
        }
示例#3
0
        private void OperattionHistory_NewOperationPushed(Operation opt)
        {
            var           eo   = opt as Operation_Element;
            var           pr   = CurFocusTreeNodeProjReferrencer;
            UserTaskGroup grp  = SelectedTaskGroup;
            LoginUserInfo user = SelectedUserInfo;

            if (grp == null && user != null)
            {
                grp = user.ParentGroup;
            }
            ServerLoginUserInfo suser = null;

            if (user != null)
            {
                suser = user.LocalObj as ServerLoginUserInfo;
            }
            ProjectReferrencer prTarget = pr;

            if (grp.IsCooperation)
            {
                prTarget = grp;
            }
            else if (suser == null)
            {
                return;
            }
            if (opt is Operation_Element)
            {
                var eop = opt as Operation_Element;
                if (!eop.DonotMakeUserDirty)
                {
                    eop.Element.CreatorId = LoginUserInfo.SystemUserID;
                }
                if (prTarget != null && prTarget.IsStarted)
                {
                    if (eop is Operation_Element_Create)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_Create(prTarget, eop.Element));
                    }
                    else if (opt is Operation_Element_Delete)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_Delete(prTarget, eop.Element.GUID));
                    }
                    else if (opt is Operation_Element_Drift)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_Drift(prTarget, eop.Element));
                    }
                    else if (opt is Operation_Element_Flip)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_Flip(prTarget, eop.Element));
                    }
                    else if (opt is Operation_Element_ChangeProperty)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_ChangeProperty(prTarget, eop.Element,
                                                                                                                     ((Operation_Element_ChangeProperty)opt).PropertyName,
                                                                                                                     ((Operation_Element_ChangeProperty)opt).ValueNew));
                    }
                    else if (opt is Operation_Element_ChangeMaskInfo)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_SetMask(prTarget, eop.Element as ElementInfo_Mask));
                    }
                    else if (opt is Operation_Element_ChangeWaterbagInfo)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_SetWaterbag(prTarget, eop.Element as ElementInfo_Waterbag));
                    }
                    else if (opt is Operation_Element_SetHotkeyAnimation)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_HotkeyAnimation(prTarget, eop.Element));
                    }
                    //else if (opt is Operation_Element_ChangeLocation)
                    //    Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_Drive(prTarget, eop.Element,
                    //        ((Operation_Element_ChangeLocation)opt).LocationNew.X,
                    //        ((Operation_Element_ChangeLocation)opt).LocationNew.Y));
                    else
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_Modify(prTarget, eop.Element));
                    }
                }
            }
        }
 public void SetCurrentTaskGroup(UserTaskGroup group)
 {
     Program.CurUser.ParentGroup = group;
     RefreshStudentsGroupList();
 }