Пример #1
0
 public void classLog(DllInfo dll, PlugInModel plug)
 {
     dll.ClassInfoList.Add(
         new ClassInfo()
     {
         Author     = plug.Author,
         BaseClass  = plug.BaseType.ToString(),
         CreateTime = plug.CreateDate,
         Mesg       = plug.Description,
         RegName    = plug.Key
     }
         );
 }
Пример #2
0
        private void Log(PlugInModel plug)
        {
            string log = String.Format(ObjectUtil.SysCulture, "\r\n注册名:{0}\r\n基类:{2}\r\n实例类:{1}\r\n" +
                                       "路径:{3}\r\n作者:{4}\r\n描述:{5}",
                                       plug.Key,
                                       plug.InstanceType.ToString(),
                                       plug.BaseType.ToString(),
                                       plug.InstanceType.Assembly.Location,
                                       plug.Author,
                                       plug.Description
                                       );

            // AtawAppContext.Current.Logger.Debug("注册插件", log);
            SysTxtBuilder.Current.Append(log);
        }
Пример #3
0
        public PlugInModel RegisterPlugIn(Type to, Type from, string Regname)
        {
            string regname = from.AssemblyQualifiedName + Regname;
            var    plug    = PlugInModelList[regname];

            if (plug == null)
            {
                InternalRegisterType(from, to, Regname);
                // InternalRegisterType(
                var model = new PlugInModel();
                model.BaseType     = from;
                model.InstanceType = to;
                model.RegName      = regname;
                model.Key          = Regname;
                PlugInModelList.Add(model);
                return(model);
            }
            return(plug);
        }
Пример #4
0
        public PlugInModel RegisterPlugIn <T>(T instance, string Regname)
        {
            RegisterType <T>(instance, Regname);
            string key  = typeof(T).AssemblyQualifiedName + Regname;
            var    plug = PlugInModelList[key];

            // PlugInModel model = null;
            if (plug == null)
            {
                plug              = new PlugInModel();
                plug.BaseType     = typeof(T);
                plug.InstanceType = plug.BaseType;
                plug.RegName      = key;
                plug.Key          = Regname;
                PlugInModelList.Add(plug);
                //return model;
            }
            Log(plug);
            return(plug);
        }