コード例 #1
0
        private void addBtn_Click(object sender, EventArgs e)
        {
            Role temp = new Role();

            if (nameTxt.Text == string.Empty)
            {
                MessageBox.Show("Name field is blank. Please enter a name or click cancel");
            }
            else
            {
                temp.Title = nameTxt.Text;
                temp.Colour = colorPicker.Color;

                Main.Roles.Add(temp);

                this.Close();
            }
        }
コード例 #2
0
 public void AddRole(Role role)
 {
     m_roles.Add(role);
 }
コード例 #3
0
 public Employee(string name, Role role)
 {
     m_name = name;
     m_roles.Add(role);
 }