Пример #1
0
 private void JobComboBox_TextChanged(object sender, EventArgs e)
 {
     if (this.IsFirstMemberUnit)
     {
         Registry.WriteFirstMemberJob(AION.GetJobName((AION.JobType) this.JobComboBox.SelectedValue));
     }
 }
 private void SaveMember(ControlCollection Controls)
 {
     foreach (Control _Control in Controls)
     {
         if (_Control.GetType().Name.Equals("TextBox"))
         {
             TextBox _TextBox = (TextBox)_Control;
             this.SaveRegistryMemberName(int.Parse((string)_TextBox.Tag), _TextBox.Text);
         }
         else if (_Control.GetType().Name.Equals("ComboBox"))
         {
             ComboBox _ComboBox = (ComboBox)_Control;
             this.SaveRegistryMemberJob(int.Parse((string)_ComboBox.Tag), AION.GetJobName((AION.JobType)_ComboBox.SelectedValue));
         }
     }
 }
Пример #3
0
        public MemberUnit()
        {
            InitializeComponent();

            List <AION.JobSet> JobSetList = new List <AION.JobSet>();

            foreach (AION.JobType Job in Enum.GetValues(typeof(AION.JobType)))
            {
                JobSetList.Add(new AION.JobSet(Job, AION.GetJobName(Job)));
            }

            this.JobComboBox.Items.Clear();
            this.JobComboBox.DataSource            = JobSetList;
            this.JobComboBox.DisplayMember         = "Name";
            this.JobComboBox.ValueMember           = "Type";
            this.JobComboBox.SelectedIndex         = 0;
            this.JobComboBox.SelectedValueChanged += new System.EventHandler(this.JobComboBox_TextChanged);
        }
        private void InitiallizeComponentMember(ControlCollection _Controls)
        {
            foreach (Control _Control in _Controls)
            {
                if (_Control.GetType().Name.Equals("Button"))
                {
                    if (((Button)_Control).Name.IndexOf("Insert") == 0)
                    {
                        ((Button)_Control).Click += new EventHandler(InsertButton_Click);
                    }
                }
                else if (_Control.GetType().Name.Equals("TextBox"))
                {
                    TextBox _TextBox = (TextBox)_Control;
                    _TextBox.Text = this.GetRegistryMemberName(int.Parse((string)_TextBox.Tag));
                }
                else if (_Control.GetType().Name.Equals("ComboBox"))
                {
                    List <AION.JobSet> JobSetList = new List <AION.JobSet>();
                    foreach (AION.JobType Job in Enum.GetValues(typeof(AION.JobType)))
                    {
                        JobSetList.Add(new AION.JobSet(Job, AION.GetJobName(Job)));
                    }

                    ComboBox _ComboBox = (ComboBox)_Control;
                    _ComboBox.Items.Clear();
                    _ComboBox.DataSource    = JobSetList;
                    _ComboBox.DisplayMember = "Name";
                    _ComboBox.ValueMember   = "Type";
                    try
                    {
                        _ComboBox.SelectedValue = AION.GetJobType(this.GetRegistryMemberJob(int.Parse((string)_ComboBox.Tag)));
                    }
                    catch
                    {
                        _ComboBox.SelectedValue = AION.JobType.None;
                    }
                }
            }
        }
Пример #5
0
 public void SetJob(AION.JobType JobType)
 {
     this.JobLabel.Text = AION.GetJobName(JobType);
 }