private void AddXmlRule(IXmlPlugInItem config, Type xmlType, BasePlugInAttribute dummyAttribute)
 {
     RuleConfigItem item = config.Convert<RuleConfigItem>();
     RuleAttribute attr = item.Match.CreateObject();
     attr.RegName = config.RegName;
     attr.AppId = item.AppId;
     WeixinToolkitSettings.Current.Engine.Add(attr);
 }
예제 #2
0
 public XmlRegItem(string regName, IXmlPlugInItem xmlConfig,
                   Type baseClassType, string fileName)
     : base(regName, new XmlDummyPlugInAttribute(regName, xmlConfig))
 {
     XmlConfig     = xmlConfig;
     BaseClassType = baseClassType;
     FileName      = fileName;
 }
예제 #3
0
 private void AddPlugInXmlItems(IEnumerator items, string fileName)
 {
     while (items.MoveNext())
     {
         IXmlPlugInItem item = items.Current as IXmlPlugInItem;
         AddPlugInXmlItem(item, fileName);
     }
 }
예제 #4
0
 public XmlDummyPlugInAttribute(string regName, IXmlPlugInItem item)
     : base()
 {
     RegName     = regName;
     Author      = item.Author;
     CreateDate  = item.CreateDate;
     Description = item.Description;
 }
예제 #5
0
 internal PlugInInfo(IXmlPlugInItem item, string fileName, Type baseType, BasePlugInAttribute attr)
     : base(item.RegName, attr)
 {
     FileName  = fileName;
     TypeName  = baseType.ToString();
     BaseClass = item.BaseClass;
     PlugType  = PlugInType.Xml;
 }
        private void AddXmlRule(IXmlPlugInItem config, Type xmlType, BasePlugInAttribute dummyAttribute)
        {
            RuleConfigItem item = config.Convert <RuleConfigItem>();
            RuleAttribute  attr = item.Match.CreateObject();

            attr.RegName = config.RegName;
            attr.AppId   = item.AppId;
            WeixinToolkitSettings.Current.Engine.Add(attr);
        }
예제 #7
0
        protected override void Add(string regName, IXmlPlugInItem plugItem, Type baseType)
        {
            base.Add(regName, plugItem, baseType);

            PageTemplateConfigItem config = plugItem.Convert <PageTemplateConfigItem>();

            if (!string.IsNullOrEmpty(config.DefaultModelCreator))
            {
                fDefault.Add(regName, config.DefaultModelCreator);
            }
        }
예제 #8
0
        private void AddPlugInXmlItem(IXmlPlugInItem item, string fileName)
        {
            Type baseClassType = GetBaseClassType(item.BaseClass);

            if (Contains(item.RegName))
            {
                TkDebug.ThrowIfNoGlobalVariable();
                BaseGlobalVariable.Current.AddXmlError(item.RegName, fileName, PlugInErrorType.Duplicate);
            }
            else
            {
                TkTrace.LogInfo($"工厂[{Description}]添加注册名为{item.RegName}的插件");
                fXmlPlugIns.Add(item.RegName, new XmlRegItem(item.RegName, item, baseClassType, fileName));
                Add(item.RegName, item, baseClassType);
            }
        }
예제 #9
0
 protected virtual void Add(string regName, IXmlPlugInItem plugItem, Type baseType)
 {
 }