예제 #1
0
        private void AddXmlConfigXml(ToolkitConfig config, XmlConfigInfo configInfo)
        {
            string path = Path.GetFileName(config.FullPath);

            foreach (XmlPlugInItemInfo configItem in configInfo.ConfigItems)
            {
                object value = ObjectUtil.GetValue(configItem.PropertyInfo, config);
                if (value != null)
                {
                    switch (configItem.Type)
                    {
                    case XmlPlugInItemType.Single:
                        AddPlugInXmlItem(value as IXmlPlugInItem, path);
                        break;

                    case XmlPlugInItemType.Enumerable:
                        AddPlugInXmlItems(value as IEnumerable, path);
                        break;

                    case XmlPlugInItemType.Enumerator:
                        AddPlugInXmlItems(value as IEnumerator, path);
                        break;
                    }
                }
            }
        }
예제 #2
0
 public XmlPlugInAttribute(string xmlPath, Type xmlConfigType)
 {
     XmlConfigType = xmlConfigType;
     XmlPath       = xmlPath;
     ConfigInfo    = new XmlConfigInfo(xmlConfigType, true);
 }