Esempio n. 1
0
        private ControlBase AddControl(FormControlType type)
        {
            string      key;
            ControlBase control = null;

            ServicesProfile profile = Wkl.MainCtrl.ServiceCtrl.CreateProfile(out key);

            profile.PdmProfile.ControlType = type;
            profile.PdmProfile.IsAdding    = true;

            MainManager manager = new MainManager();

            try
            {
                manager.MainService.PdmService.AddControl(key);
                control = profile.PdmProfile.Control;
            }
            catch (Exception e)
            {
                throw e;
            }

            Wkl.MainCtrl.ServiceCtrl.RemoveDataObject(key);

            return(control);
        }
        public static FormControlType ToControlType(this string src)
        {
            FormControlType type;

            FormControlType.TryParse(src, out type);
            return(type);
        }
Esempio n. 3
0
        private FormControl AddControlInternal(FormControlType type, string id, string q = "", bool req = false, FormControlSelectableType selectableType = FormControlSelectableType.Unknown, Type selectableSection = null)
        {
            var fc = new FormControl(type, id, selectableType, selectableSection, q, req);

            _controls.Add(id, fc);
            return(fc);
        }
 public FormUserControl GetUserControl( FormControlType controlType )
 {
     if ( mUserControlList.ContainsKey( controlType ) )
         return mUserControlList[ controlType ];
     else
         return null;
 }
        //按钮
        public static List <FormControlConfig> Add(this List <FormControlConfig> controls,
                                                   string lable, FormControlType type,
                                                   string value = "", string id       = "",
                                                   string regex = "", string inputTip = "", string errorTip = "")
        {
            var cfg = new FormControlConfig(lable, id, value, type, -1, regex, inputTip, errorTip);

            return(Add(controls, cfg));
        }
Esempio n. 6
0
        private static void Add(FormControlType type, Func <WidgetContext, TField, IWidget> func)
        {
            if (RegisteredWidgets.ContainsKey(type))
            {
                throw new Exception("Control of type " + type + " is already registered.");
            }

            RegisteredWidgets.Add(type, func);
        }
Esempio n. 7
0
 internal FormControl(FormControlType type, string id, FormControlSelectableType selectableType,
                      Type selectableSection, string q, bool req)
 {
     SelectableType    = selectableType;
     SelectableSection = selectableSection;
     Type     = type;
     Id       = id;
     Question = q;
     Required = req;
 }
        //其他
        public static List <FormControlConfig> Add(this List <FormControlConfig> controls,
                                                   string lable, string name, FormControlType type,
                                                   string crossWidth, List <DropDownListItem> items,
                                                   string value = "", string id       = "",
                                                   string regex = "", string inputTip = "", string errorTip = "")
        {
            var cfg = new FormControlConfig(lable, id, name, value, type, crossWidth, items, -1, regex, inputTip, errorTip);

            return(Add(controls, cfg));
        }
        //tip
        public static List <FormControlConfig> Add(this List <FormControlConfig> controls,
                                                   string lable, FormControlType type)
        {
            var value    = "";
            var id       = "";
            var regex    = "";
            var inputTip = "";
            var errorTip = "";

            return(Add(controls, lable, type, value, id, regex, inputTip, errorTip));
        }
 public FormUserControl GetUserControl(FormControlType controlType)
 {
     if (mUserControlList.ContainsKey(controlType))
     {
         return(mUserControlList[controlType]);
     }
     else
     {
         return(null);
     }
 }
Esempio n. 11
0
 //非下拉
 public BaseControlConfig(string lable, string id, string value,
                          FormControlType type, int sequence)
 {
     this.id         = id;
     this.name       = id;
     this.type       = type;
     this.sequence   = sequence;
     this.lable      = lable;
     this.crossWidth = "1";
     this.value      = value;
     this.items      = new List <DropDownListItem>();
 }
Esempio n. 12
0
 //全集
 public BaseControlConfig(string lable, string id, string name, string value, FormControlType type,
                          string crossWidth, List <DropDownListItem> items, int sequence
                          )
 {
     this.id         = id;
     this.name       = name;
     this.type       = type;
     this.sequence   = sequence;
     this.lable      = lable;
     this.crossWidth = crossWidth;
     this.value      = value;
     this.items      = items.Format();
 }
Esempio n. 13
0
        public static bool IsWidgetOnFullRow(FormControlType ctrlType)
        {
            switch (ctrlType)
            {
            case FormControlType.XmlEditor:
            case FormControlType.ListForm:
            case FormControlType.EntityListView:
            case FormControlType.HtmlText:
                return(true);

            default:
                return(false);
            }
        }
Esempio n. 14
0
 public FormControlConfig(string lable, string id, string value,
                          FormControlType type, int sequence,
                          string regex, string input_tip, string error_tip)
 {
     this.id         = id;
     this.name       = id;
     this.type       = type;
     this.sequence   = sequence;
     this.lable      = lable;
     this.crossWidth = "1";
     this.value      = value;
     this.items      = new List <DropDownListItem>();
     this.regex      = regex;
     this.input_tip  = input_tip;
     this.error_tip  = error_tip;
 }
Esempio n. 15
0
        private ControlBase Add(FormControlType type, Word.Range range)
        {
            ControlBase control = null;

            switch (type)
            {
            case FormControlType.TextInput:
                control = _vstoDoc.Controls.AddControl <TextInput>(range);
                break;

            case FormControlType.TextArea:
                control = _vstoDoc.Controls.AddControl <TextArea>(range);
                break;

            case FormControlType.CheckBox:
                control = _vstoDoc.Controls.AddControl <CheckBox>(range);
                break;

            case FormControlType.Radio:
                control = _vstoDoc.Controls.AddControl <Radio>(range);
                break;

            case FormControlType.Button:
                control = _vstoDoc.Controls.AddControl <Button>(range);
                break;

            case FormControlType.Select:
                control = _vstoDoc.Controls.AddControl <Select>(range);
                break;

            case FormControlType.CheckBoxList:
                control = _vstoDoc.Controls.AddControl <CheckBoxList>(range);
                break;

            case FormControlType.RadioList:
                control = _vstoDoc.Controls.AddControl <RadioList>(range);
                break;

            default:
                throw new NotSupportedException();
            }

            return(control);
        }
        public void SwitchUserControl( FormControlType controlType, FormControlSwitchType switchType, object userObject )
        {
            if ( mDisplayedUserControl != null )
            {
                mDisplayedUserControl.OnControlHide( switchType, userObject );
                mDisplayedUserControl.GetControl().Hide();
            }

            if ( mUserControlList.ContainsKey( controlType ) )
                mDisplayedUserControl = mUserControlList[ controlType ];
            else
                mDisplayedUserControl = null;

            if ( mDisplayedUserControl != null )
            {
                mDisplayedUserControl.GetControl().Show();
                mDisplayedUserControl.OnControlShow( switchType, userObject );
            }
        }
        public void SwitchUserControl(FormControlType controlType, FormControlSwitchType switchType, object userObject)
        {
            if (mDisplayedUserControl != null)
            {
                mDisplayedUserControl.OnControlHide(switchType, userObject);
                mDisplayedUserControl.GetControl().Hide();
            }

            if (mUserControlList.ContainsKey(controlType))
            {
                mDisplayedUserControl = mUserControlList[controlType];
            }
            else
            {
                mDisplayedUserControl = null;
            }

            if (mDisplayedUserControl != null)
            {
                mDisplayedUserControl.GetControl().Show();
                mDisplayedUserControl.OnControlShow(switchType, userObject);
            }
        }
Esempio n. 18
0
        private void mButtonNext_Click(object sender, EventArgs e)
        {
            FormControlType nextForm = FormControlType.AddVolume2a;

            PWLib.FileSyncLib.VolumeType volType = PWLib.FileSyncLib.VolumeType.UsbDevice;
            if (mRadio1.Checked)
            {
                volType  = PWLib.FileSyncLib.VolumeType.UsbDevice;
                nextForm = FormControlType.AddVolume2b;
            }
            else if (mRadio2.Checked)
            {
                volType  = PWLib.FileSyncLib.VolumeType.LocalFolder;
                nextForm = FormControlType.AddVolume2a;
            }
            else if (mAddExistingRadio.Checked)
            {
                nextForm = FormControlType.AddVolume2c;
            }

            mObject.VolumeType = volType;

            MainForm.Instance.ControlSwitcher.SwitchUserControl(nextForm, FormControlSwitchType.Next, mObject);
        }
 public void SwitchUserControl(FormControlType controlType, FormControlSwitchType switchType)
 {
     SwitchUserControl(controlType, switchType, null);
 }
 public static List <FormControlType> GetAllControlType(this FormControlType src)
 {
     return(Enum.GetNames(typeof(FormControlType)).Select(a => a.ToControlType()).ToList());
 }
Esempio n. 21
0
 public ReportControlConfig(string lable, string id, string name, string value, FormControlType type, string crossWidth, List <DropDownListItem> items, int sequence)
     : base(lable, id, name, value, type, crossWidth, items, sequence)
 {
 }
Esempio n. 22
0
 public ReportControlConfig(string lable, string id, string value, FormControlType type, int sequence) : base(lable, id, value, type, sequence)
 {
 }
Esempio n. 23
0
 public Form(string lable, Show show, FormControlType controlType)
 {
     Lable       = lable;
     Show        = show;
     ControlType = controlType;
 }
Esempio n. 24
0
 public Form()
 {
     this.Show        = Show.None;
     this.ControlType = FormControlType.Input;
 }
Esempio n. 25
0
        public static List <ReportControlConfig> Add(this List <ReportControlConfig> controls, string lable, FormControlType type, string value = "", string id = "")
        {
            var cfg = new ReportControlConfig(lable, id, value, type, -1);

            return(Add(controls, cfg));
        }
Esempio n. 26
0
        public static List <ReportControlConfig> Add(this List <ReportControlConfig> controls, string lable, string name, FormControlType type,
                                                     string crossWidth, List <DropDownListItem> items, string value = "", string id = "")
        {
            var cfg = new ReportControlConfig(lable, id, name, value, type, crossWidth, items, -1);

            return(Add(controls, cfg));
        }
Esempio n. 27
0
 public static Func <WidgetContext, TField, IWidget> Get(FormControlType widgetType)
 {
     return(RegisteredWidgets[widgetType]);
 }
Esempio n. 28
0
 public FormControlConfig(string lable, string id, string name, string value, FormControlType type, string crossWidth, List <DropDownListItem> items, int sequence, string regex, string inputTip, string errorTip) : base(lable, id, name, value, type, crossWidth, items, sequence)
 {
     this.regex = regex;
     input_tip  = inputTip;
     error_tip  = errorTip;
 }
Esempio n. 29
0
        //tip
        public static List <ReportControlConfig> Add(this List <ReportControlConfig> controls, string lable, FormControlType type)
        {
            var value = "";
            var id    = "";

            return(Add(controls, lable, type, value, id));
        }
Esempio n. 30
0
 public static List <FormControlConfig> Add(this List <FormControlConfig> controls, string lable, string name, FormControlType type,
                                            string crossWidth, List <SelectListItem> items, string value = "", string id = "")
 {
     return(Add(controls, lable, name, type, crossWidth, items.ToDropDownListItem(), value, id));
 }
 public void SwitchUserControl( FormControlType controlType, FormControlSwitchType switchType )
 {
     SwitchUserControl( controlType, switchType, null );
 }
Esempio n. 32
0
 public static bool HasKey(FormControlType widgetType)
 {
     return(RegisteredWidgets.ContainsKey(widgetType));
 }
Esempio n. 33
0
        internal static FormControlType GetDefaultControl(FieldType type)
        {
            FormControlType t = FormControlType.TextBox;

            switch (type)
            {
            case FieldType.BigInt:
                t = FormControlType.NumberBox;
                break;

            case FieldType.Bool:
                t = FormControlType.CheckBox;
                break;

            case FieldType.Date:
                t = FormControlType.DatePicker;
                break;

            case FieldType.DateTime:
                t = FormControlType.DateTimePicker;
                break;

            case FieldType.Decimal:
                t = FormControlType.DecimalBox;
                break;

            case FieldType.Integer:
                t = FormControlType.NumberBox;
                break;

            case FieldType.LongText:
                t = FormControlType.LongText;
                break;

            case FieldType.Password:
                t = FormControlType.Password;
                break;

            case FieldType.ObjectLink:
            case FieldType.MultiObjectLink:
                t = FormControlType.EntityPicker;
                break;

            case FieldType.MonataryAmount:
                t = FormControlType.DecimalBox;
                break;

            case FieldType.Select:
            case FieldType.MultiSelect:
                t = FormControlType.Dropdown;
                break;

            case FieldType.Image:
                t = FormControlType.Image;
                break;

            case FieldType.Html:
                t = FormControlType.HtmlText;
                break;

            case FieldType.Email:
                t = FormControlType.Email;
                break;

            case FieldType.Phone:
                t = FormControlType.Phone;
                break;

            case FieldType.Xml:
                t = FormControlType.XmlEditor;
                break;

            case FieldType.Json:
                t = FormControlType.JsonEditor;
                break;

            case FieldType.StackScript:
                t = FormControlType.StackScriptEditor;
                break;

            case FieldType.FilterField:
                t = FormControlType.EntityFilter;
                break;

            case FieldType.OneToMany:
                t = FormControlType.ListForm;
                break;
            }

            return(t);
        }