Пример #1
0
        public static DataTable GetTableByStragList(List <BaseStragClass <T> > Strags)
        {
            DataTable dt = new DataTable();

            string strcols = "策略ID,策略描述,按车号视图,策略参数,策略名称,策略类名";

            string[] cols = strcols.Split(',');
            for (int i = 0; i < cols.Length; i++)
            {
                dt.Columns.Add(cols[i]);
            }
            for (int i = 0; i < Strags.Count; i++)
            {
                BaseStragClass <T> jcls = Strags[i];
                DataRow            dr   = dt.NewRow();
                dr[0] = jcls.GUID;
                dr[1] = jcls.StragScript;
                dr[2] = jcls.BySer;
                dr[3] = jcls.StagSetting.ToString();
                dr[4] = jcls.StragClassName;
                dr[5] = jcls.StragTypeName;
                dt.Rows.Add(dr);
            }
            return(dt);
        }
Пример #2
0
        public static BaseStragClass <T> getStragByName(string className)
        {
            Assembly           asmb = typeof(BaseStragClass <T>).Assembly;// Assembly.LoadFrom("EnterpriseServerBase.dll");
            Type               sct  = asmb.GetType(className);
            BaseStragClass <T> sc   = Activator.CreateInstance(sct) as BaseStragClass <T>;

            return(sc);
        }