示例#1
0
        public DialogForm(DialogBase content, DialogButtons buttons)
            : this(content)
        {
            bool btnOK     = (buttons & DialogButtons.Ok) == DialogButtons.Ok;
            bool btnCancel = (buttons & DialogButtons.Cancel) == DialogButtons.Cancel;
            bool btnApply  = (buttons & DialogButtons.Apply) == DialogButtons.Apply;

            if (!btnApply)
            {
                if (!btnCancel)
                {
                    _btnOK.Left = _btnApply.Left;
                }
                else
                {
                    _btnOK.Left     = _btnCancel.Left;
                    _btnCancel.Left = _btnApply.Left;
                }
            }
            else
            {
                if (!btnCancel)
                {
                    _btnOK.Left = _btnCancel.Left;
                }
            }
            _btnOK.Visible     = btnOK;
            _btnCancel.Visible = btnCancel;
            _btnApply.Visible  = btnApply;
        }
示例#2
0
        private DialogForm(DialogBase content)
            : this()
        {
            _dialog = content;
            if (content != null)
            {
                UpdateSize();
                ShowContent();

                content.SizeChanged += OnContentSizeChanged;

                _expandable = content as IExpandableDialog;
                if (_expandable != null)
                {
                    _expanded = true;
                    var exDialog = (IExpandableDialog)content;
                    CreateBitmaps(exDialog.ExpansionName);
                    _picAdvanced.Visible = true;
                    _expansionControl    = exDialog.ExpansionControl;
                }
                _elevated   = content as IElevatedExecutableDialog;
                _executable = content as IExecutableDialog;
            }
        }