예제 #1
0
        void GetObjInfo()
        {
            DirectoryInfo fdir = new DirectoryInfo(Application.StartupPath + "\\Plus");

            FileInfo[] file = fdir.GetFiles("*.dll", SearchOption.TopDirectoryOnly);
            //lup_dll.Properties.DataSource = file;

            string strdllName = "dll名称";

            System.Reflection.Assembly assembly = System.Reflection.Assembly.LoadFrom(Application.StartupPath + "\\Plus\\" + strdllName);
            System.Type[] types = assembly.GetTypes();
            foreach (var item in types)
            {
                if (item.BaseType.Name == "CiorderBaseControl")
                {
                    Type type             = assembly.GetType(item.FullName);
                    CiorderBaseControl rm = (CiorderBaseControl)Activator.CreateInstance(type);

                    CiOrdSheet sheet = new CiOrdSheet();
                    sheet.Name         = rm.SheetName;
                    sheet.Des          = rm.SheetDes;
                    sheet.Dll_model    = strdllName;
                    sheet.Dll_assembly = type.FullName;

                    sheetList.Add(sheet);
                }
            }
            //gc_dllcavas.DataSource = dt;
        }
예제 #2
0
 /// <summary>
 /// 根据id值查找组件AggDO数据
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public CiOrdSheet findById(String id)
 {
     #region "缓存处理"
     if (ch.IsCached("findById"))
     {
         return(ch.findById(id));
     }
     #endregion
     List <object> param = new List <object>();
     param.Add(id);
     si.url = url_r;
     CiOrdSheet rtn = si.invoke <CiOrdSheet>("findById", param.ToArray());
     return(rtn);
 }
예제 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="strSdsrvtp"></param>
        /// <returns></returns>
        public CiorderBaseControl GetSheet(string strSdsrvtp)
        {
            CiOrdSheet sheet = GetSheetId(strSdsrvtp);

            if (sheet == null)
            {
                return(null);
            }

            string libName     = sheet.Dll_model;
            string dllAssembly = sheet.Dll_assembly;

            try {
                Assembly           assembly = Assembly.LoadFrom(Application.StartupPath + "\\CiSheetPlus\\" + libName);
                Type               type     = assembly.GetType(dllAssembly);
                CiorderBaseControl canvas   = (CiorderBaseControl)Activator.CreateInstance(type);

                return(canvas);
            }
            catch (Exception e) {
                throw new Exception(e.ToString());
            }
        }