Beispiel #1
0
        private void OnGameEvent(GameEvent evt)
        {
            switch (evt.type)
            {
            case ClientEventID.NET_CONNECTED_OPEN:
            {
                this.ShowState(eFormStatusType.Account, "已连接");
            }
            break;

            case ClientEventID.NET_CONNECTED_CLOSE:
            {
                this.ShowState(eFormStatusType.Account, "未连接");
                this.ShowState(eFormStatusType.User, "未登陆");
                this.ShowState(eFormStatusType.Scene, "当前场景");
            }
            break;

            case ClientEventID.SHOW_MESSAGE:
            {
                string msg   = evt.Get <string>(0);
                string title = evt.Get <string>(1);
                MessageBox.Show(msg, title, MessageBoxButtons.OK);
            }
            break;

            case ClientEventID.SHOW_STATUS:
            {
                eFormStatusType type = evt.Get <eFormStatusType>(0);
                switch (type)
                {
                case eFormStatusType.Account:
                case eFormStatusType.User:
                case eFormStatusType.Scene:
                    string msg = evt.Get <string>(1);
                    this.ShowState(type, msg);
                    break;

                case eFormStatusType.Log:
                    msg = evt.Get <string>(1);
                    this.ShowState(type, msg);
                    break;
                }
            }
            break;

            case ClientEventID.OPEN_FORM:
            {
                eFormType form_type = evt.Get <eFormType>(0);
                switch (form_type)
                {
                case eFormType.CreateUser:
                    CreateUserForm create_form = new CreateUserForm();
                    create_form.ShowDialog();
                    break;
                }
            }
            break;
            }
        }
 public EditEnumForm(string enumName)
 {
     InitializeComponent();
     this.type = eFormType.New;
     this.enumName = enumName;
     this.enumValue = new IdentifiableName();
     LoadLanguage();
 }
        public EditEnumForm(string enumName, IdentifiableName enumValue)
        {
            InitializeComponent();
            this.type = eFormType.Edit;
            this.enumName = enumName;
            this.enumValue = enumValue;

            EnumIdTextBox.Text = enumValue.Id.ToString();
            EnumNameTextBox.Text = enumValue.Name;
            LoadLanguage();
        }
 public TimeEntryForm(Issue issue, IList<ProjectMember> projectMembers)
 {
     InitializeComponent();
     this.issue = issue;
     this.projectMembers = projectMembers;
     type = eFormType.New;
     CurTimeEntry = new TimeEntry();
     LoadLanguage();
     LoadCombos();
     comboBoxByUser.SelectedValue = RedmineClientForm.Instance.CurrentUser.Id;
 }
 public TimeEntryForm(Issue issue, IList <ProjectMember> projectMembers)
 {
     InitializeComponent();
     this.issue          = issue;
     this.projectMembers = projectMembers;
     type         = eFormType.New;
     CurTimeEntry = new TimeEntry();
     LoadLanguage();
     LoadCombos();
     comboBoxByUser.SelectedValue = RedmineClientForm.Instance.CurrentUser.Id;
 }
        private string enumName; // the name of the enumeration set.

        public EditEnumForm(string enumName, eFormType type, Enumerations.EnumerationItem enumValue)
        {
            InitializeComponent();
            this.type = type;
            this.enumName = enumName;
            this.enumValue = enumValue;

            if (this.type == eFormType.Edit)
            {
                EnumIdTextBox.Text = enumValue.Id.ToString();
                EnumNameTextBox.Text = enumValue.Name;
                EnumIsDefaultCheckBox.Checked = enumValue.IsDefault;
            }
            LoadLanguage();
        }
        private string enumName; // the name of the enumeration set.

        public EditEnumForm(string enumName, eFormType type, Enumerations.EnumerationItem enumValue)
        {
            InitializeComponent();
            this.type      = type;
            this.enumName  = enumName;
            this.enumValue = enumValue;

            if (this.type == eFormType.Edit)
            {
                EnumIdTextBox.Text            = enumValue.Id.ToString();
                EnumNameTextBox.Text          = enumValue.Name;
                EnumIsDefaultCheckBox.Checked = enumValue.IsDefault;
            }
            LoadLanguage();
        }
Beispiel #8
0
 protected virtual void bbpSaveAndAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (ValidationForm())
     {
         if (SaveData())
         {
             ShowAlert("Lưu dữ liệu thành công");
             fType = eFormType.Add;
             Text  = MsgAdd;
             LoadDataForm();
         }
         else
         {
             ShowAlert("Lưu dữ liệu thất bại. Xin vui lòng thử lại.");
         }
     }
 }
        public TimeEntryForm(Issue issue, IList<ProjectMember> projectMembers, TimeEntry timeEntry)
        {
            InitializeComponent();
            this.issue = issue;
            this.projectMembers = projectMembers;
            type = eFormType.Edit;
            CurTimeEntry = timeEntry;
            LoadLanguage();
            LoadCombos();

            if (CurTimeEntry.SpentOn.HasValue)
                datePickerSpentOn.Value = CurTimeEntry.SpentOn.Value;

            comboBoxByUser.SelectedValue = CurTimeEntry.User.Id;
            comboBoxActivity.SelectedValue = CurTimeEntry.Activity.Id;
            textBoxSpentHours.Text = CurTimeEntry.Hours.ToString();
            textBoxComment.Text = CurTimeEntry.Comments;
        }
        protected async virtual void bbpSaveAndAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (ValidationForm())
            {
                bool res = await SaveData();

                if (res)
                {
                    clsGeneral.showMessage("Lưu dữ liệu thành công.");
                    fType = eFormType.Add;
                    RenewData();
                    ResetControl();
                    LoadData(0);
                }
                else
                {
                    clsGeneral.showMessage("Lưu dữ liệu thất bại. Xin vui lòng thử lại.");
                }
            }
        }
        public TimeEntryForm(Issue issue, IList <ProjectMember> projectMembers, TimeEntry timeEntry)
        {
            InitializeComponent();
            this.issue          = issue;
            this.projectMembers = projectMembers;
            type         = eFormType.Edit;
            CurTimeEntry = timeEntry;
            LoadLanguage();
            LoadCombos();

            if (CurTimeEntry.SpentOn.HasValue)
            {
                datePickerSpentOn.Value = CurTimeEntry.SpentOn.Value;
            }

            comboBoxByUser.SelectedValue   = CurTimeEntry.User.Id;
            comboBoxActivity.SelectedValue = CurTimeEntry.Activity.Id;
            textBoxSpentHours.Text         = CurTimeEntry.Hours.ToString(Lang.Culture);
            textBoxComment.Text            = CurTimeEntry.Comments;
        }