Beispiel #1
0
        void InitTestTable()
        {
            data.TableName = "任务设置";
            SimuHelpers.GetTaskFields().ToList().ForEach(a =>
            {
                var new_column         = new DataColumn();
                new_column.ColumnName  = a.Name;
                new_column.DataType    = a.PropertyType;
                new_column.AllowDBNull = false;
                {
                    var attr = a.ConvertTo <DescriptionAttribute>();
                    if (attr != null)
                    {
                        new_column.Caption = attr.Description;
                    }
                }
                {
                    var attr = a.ConvertTo <DefaultValueAttribute>();
                    if (attr != null)
                    {
                        new_column.DefaultValue = attr.Value;
                    }
                }
                {
                    var attr = a.ConvertTo <UniqueAttribute>();
                    if (attr != null)
                    {
                        new_column.Unique = true;
                    }
                }

                data.Columns.Add(new_column);
            });
            InitTestData();
        }
Beispiel #2
0
 private void SimuDialog_Load(object sender, EventArgs e)
 {
     comboBox1.DataSource    = SimuHelpers.InitSelectedData();
     comboBox1.DisplayMember = "Key";
     comboBox1.ValueMember   = "Value";
     comboBox2.Items.AddRange(Enumerable.Range(SchdSettings.MinTimeSpan, SchdSettings.MaxTimeSpan - SchdSettings.MinTimeSpan + 1).Cast <object>().ToArray());
     comboBox2.SelectedIndex = 0;
     InitWorker();
 }
Beispiel #3
0
 public RumtimeSchd(DataTable table)
 {
     this.table  = table;
     type_fields = SimuHelpers.GetTypeFields();
     task_fields = SimuHelpers.GetTaskFields();
 }