/// <summary> /// 返回一个本控件的窗体 /// </summary> public static FormModel CreateForm(RuleInfo[] rules) { DataFilter dm = new DataFilter(); dm.AllRules = rules; dm.Dock = DockStyle.Fill; FormModel tf = new FormModel(); tf.Size = new Size(dm.Width + 17, dm.Size.Height + 40); tf.Controls.Add(dm);//将控件添加到窗体中 tf.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; return tf; }
bool IsSetConditon;//是否设置过条件,否则将按照默认条件进行处理 #endregion #region 得到包含此控件的窗体 /// <summary> /// 得到控件的窗体 /// </summary> /// <param name="curEntityName">当前实体的类型名称</param> /// <returns>窗体</returns> public static FormModel CreateForm(string curEntityName) { SearchCondition sc = new SearchCondition(); sc.CutEntityName = curEntityName; sc.Name = "SC"; FormModel tf = new FormModel(); tf.Size = new Size(sc.Width + 15, sc.Size.Height + 40); tf.Controls.Add(sc);//将控件添加到窗体中 tf.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; return tf; }
/// <summary> /// 创建数据管理窗体,需要重新写 /// </summary> /// <param name="controlParams">控件参数</param> /// <returns>数据管理控件的窗体</returns> public static FormModel CreateForm2(DataControlParams controlParams) { //默认的集成不能完成,需要修改生成的主窗体 DataPrediction dm = new DataPrediction(); dm.InitializeSettings(controlParams); dm.Name = "dm"; dm.Dock = DockStyle.Fill; FormModel tf = new FormModel(); tf.Size = new Size(dm.Width + 15, dm.Size.Height + 40); tf.Controls.Add(dm);//将控件添加到窗体中 tf.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle ; return tf; }
public static FormModel CreateForm(DataControlParams controlParams) { AddIndexInfo EntityControl = new AddIndexInfo(); EntityControl.InitializeSettings(controlParams); EntityControl.Dock = System.Windows.Forms.DockStyle.Fill; EntityControl.Location = new System.Drawing.Point(0, 0); EntityControl.Name = "AddIndexInfoCtl"; EntityControl.TabIndex = 0; FormModel tf = new FormModel(); tf.Size = new System.Drawing.Size (EntityControl.Width + 15, EntityControl.Size.Height + 40); tf.Controls.Add(EntityControl);//将控件添加到窗体中 tf.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; return tf; }
/// <summary> /// 获取搜索窗体 /// </summary> /// <returns></returns> public FormModel GetSearchForm() { if (SeachFm == null) { SeachFm = SearchCondition.CreateForm(TableName); } return SeachFm; }
/// <summary> /// 获取添加实体窗体 /// </summary> /// <returns>窗体对象</returns> public FormModel GetAddForm() { if (AddForm == null) { Assembly assembly = Assembly.LoadFrom(ControlParams.ControlAssemblyName); Type T = assembly.GetType(ControlParams.ControlName); MethodInfo mi = T.GetMethod("CreateForm"); AddForm = (FormModel)mi.Invoke(null, new object[] { ControlParams }); } return AddForm; }
/// <summary> /// 创建数据管理窗体 /// </summary> /// <param name="controlParams">控件参数</param> /// <returns>数据管理控件的窗体</returns> public static FormModel CreateForm(DataControlParams controlParams) { DataManage dm = new DataManage(); dm.InitializeSettings(controlParams); dm.Name = "dm"; dm.Dock = DockStyle.Fill; FormModel tf = new FormModel(); tf.Size = new Size(dm.Width + 15, dm.Size.Height + 40); tf.Controls.Add(dm);//将控件添加到窗体中 tf.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable; return tf; }
public static FormModel CreateForm(string filePath) { ConfigSetting config = new ConfigSetting(filePath); FormModel tf = new FormModel(); tf.Size = new Size(config.Width + 15, config.Size.Height + 40); tf.Controls.Add(config );//将控件添加到窗体中 tf.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; return tf; }