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); }
public XmlRegItem(string regName, IXmlPlugInItem xmlConfig, Type baseClassType, string fileName) : base(regName, new XmlDummyPlugInAttribute(regName, xmlConfig)) { XmlConfig = xmlConfig; BaseClassType = baseClassType; FileName = fileName; }
private void AddPlugInXmlItems(IEnumerator items, string fileName) { while (items.MoveNext()) { IXmlPlugInItem item = items.Current as IXmlPlugInItem; AddPlugInXmlItem(item, fileName); } }
public XmlDummyPlugInAttribute(string regName, IXmlPlugInItem item) : base() { RegName = regName; Author = item.Author; CreateDate = item.CreateDate; Description = item.Description; }
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); }
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); } }
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); } }
protected virtual void Add(string regName, IXmlPlugInItem plugItem, Type baseType) { }