Esempio n. 1
0
        private void UnlockAllMaidClasses(object sender, EventArgs e)
        {
            MaidInfo maid = SelectedMaid;

            for (int i = 0; i < EnumHelper.MaxMaidClass; i++)
            {
                maid.SetMaidClassValue(i, TABLE_COLUMN_HAS, true);
            }
        }
        private void UpdateMaid_YotogiClassValue <T>(DataGridView table, int col, int row)
        {
            MaidInfo maid = SelectedMaid;

            if (maid == null)
            {
                return;
            }

            object val = table[col, row].Value;

            if (val is bool)
            {
                val = !((bool)val);
            }

            if (table == dataGridView_maid_classes)
            {
                if (!updateMaidClassField)
                {
                    if (val is T)
                    {
                        maid.SetMaidClassValue(row, col, val);
                    }
                    else
                    {
                        maid.UpdateField(MaidChangeType.MaidClassType, row);
                    }
                }
                updateMaidClassField = false;
            }
            else if (table == dataGridView_yotogi_classes)
            {
                if (!updateYotogiClassField)
                {
                    if (val is T)
                    {
                        maid.SetYotogiClassValue(EnumHelper.EnabledYotogiClasses[row], col, val);
                    }
                    else
                    {
                        maid.UpdateField(MaidChangeType.YotogiClassType, EnumHelper.EnabledYotogiClasses[row]);
                    }
                }
                updateYotogiClassField = false;
            }
        }