Пример #1
0
        private void AddControlToGroup(UserRequestProperty prop, LayoutGroup group, Control control, eLayoutSizeType withType = eLayoutSizeType.Percent, int width = 100)
        {
            control.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
            var item = new LayoutControlItem()
            {
                TextVisible = true,
                WidthType   = withType,
                Width       = width,
                HeightType  = eLayoutSizeType.Absolute,
                Height      = control.Height + 8,
                Control     = control
            };

            if (control is TextBoxX)
            {
                item.MinSize = new Size(120, 0);
            }

            LayoutControl1.Controls.Add(control);
            group.Items.Add(item);
            if (control is TextBoxX)
            {
                // item.MinSize = New Size(120, 0)
                if (!prop.AllowEmptyState)
                {
                    var validor = new DevComponents.DotNetBar.Validator.RequiredFieldValidator("Requied field!")
                    {
                        HighlightColor = DevComponents.DotNetBar.Validator.eHighlightColor.Red
                    };
                    SuperValidator1.SetValidator1(control, validor);
                }
            }
        }
Пример #2
0
        // G u i

        private async void Button_Send_Clicked(object sender, EventArgs e)
        {
            bool success = false;

            if (SuperValidator1.Validate())
            {
                if (!UserRequestManager.CheckMaxAttachmentFileLength(request, 250 * 1024 * 1024))
                {
                    MessageBoxEx.Show(UserRequestGuiLangRes.MsgBox_IncludedBigFiles, UserRequestGuiLangRes.MsgBox_IncludedBigFiles_Titel, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    button_Send.Enabled = false;
                    circularProgress.Start();

                    /* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
                    success = await SendRequest();

                    /* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
                    circularProgress.Stop();
                    button_Send.Enabled = true;
                    /* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
                    if (success)
                    {
                        MessageBoxEx.Show(UserRequestGuiLangRes.MsgBox_SendingRequestSuccess, UserRequestGuiLangRes.MsgBox_SendingRequestSuccess_Titel, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Close();
                    }
                    else
                    {
                        MessageBoxEx.Show(UserRequestGuiLangRes.MsgBox_ErrorSendingRequest, UserRequestGuiLangRes.MsgBox_ErrorSendingRequest_Titel, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }