private void addUserLast(User.UserState state)
        {
            User user = new User();

            user.state = state;
            addUser(user);
        }
        private void paintGrid()
        {
            //
            // adjustment cell state
            //
            int userid = -1;

            for (int row = 0; row < grid.RowCount; row++)
            {
                for (int col = 0; col < grid.ColumnCount; col++)
                {
                    userid++;
                    User.UserState cellState = User.UserState.NONE;
                    string         cellName  = "";
                    if (userid < User.getUserCount())
                    {
                        cellState = User.getUser(userid).state;
                        cellName  = User.getUser(userid).name;
                        ((DataGridViewRolloverCell)grid.Rows[row].Cells[col]).ReadOnly = false;
                    }
                    else
                    {
                        ((DataGridViewRolloverCell)grid.Rows[row].Cells[col]).ReadOnly = true;
                    }
                    ((DataGridViewRolloverCell)grid.Rows[row].Cells[col]).setUserState(cellState);
                    ((DataGridViewRolloverCell)grid.Rows[row].Cells[col]).Value = cellName;
                }
            }
            grid.Refresh();
        }
 public void setUserState(User.UserState state)
 {
     userState = state;
     if ((int)state >= Enum.GetValues(typeof(User.UserState)).Length)
     {
         int a = 1;
     }
 }
        private void addUserLast(string name, User.UserState state)
        {
            User user = new User();

            user.name  = name;
            user.state = state;
            addUser(user);
        }
 public void setState(int userid, User.UserState state)
 {
     if (userid < User.getUserCount())
     {
         User.setUserState(userid, state);
         selectedColumn = userid % grid.ColumnCount;
         selectedRow    = getRowCount(userid + 1, grid.ColumnCount) - 1;
         changeSelectedCellState(state);
     }
 }
Esempio n. 6
0
 private User.UserState ResolveUserState(User.UserState s1, User.UserState s2)
 {
     return((User.UserState)Math.Max((byte)s1, (byte)s2));
 }
 private void changeSelectedCellState(User.UserState state)
 {
     ((DataGridViewRolloverCell)grid.Rows[selectedRow].Cells[selectedColumn]).setUserState(state);
     grid.Refresh();
 }