Пример #1
0
        /// <summary>
        /// 应用插件扩展属性
        /// </summary>
        /// <param name="dataTable">扩展数据表</param>
        /// <param name="addon">插件</param>
        public static void GetAddonExtendProperties(PaoObject addon)
        {
            if (addon == null)
            {
                return;
            }

            var keys = ConfigStoragePublic.FindConfigKeys(ExtendAddonStorageName
                                                          , (key) => {
                return(key.IndexOf(addon.ID + "&") == 0);
            });

            if (keys.IsNullOrEmpty())
            {
                return;
            }

            foreach (var key in keys)
            {
                string[] ids           = key.Split(new char[] { '&' }, 2);
                string   propertyName  = ids[1];
                var      propertyValue = ConfigStoragePublic.GetConfig(ExtendAddonStorageName, key);
                AddonPublic.SetPropertyValueByPath(addon, propertyName, propertyValue);
            }
        }
Пример #2
0
 /// <summary>
 /// 抽取插件扩展属性
 /// </summary>
 /// <param name="dataTable">扩展数据表</param>
 /// <param name="addon">插件</param>
 /// <param name="properties">需要纳入扩展的属性</param>
 public static void SetAddonExtendProperties(PaoObject addon, params string[] properties)
 {
     if (addon.IsNotNull() && properties.IsNotNullOrEmpty())
     {
         foreach (var property in properties)
         {
             var propertyValue = addon.GetPropertyValueByPath(property);
             var propertyID    = GetAddonPropertyID(addon, property);
             if (propertyValue.IsNotNull())
             {
                 ConfigStoragePublic.SetConfig(ExtendAddonStorageName, propertyID, propertyValue);
             }
         }
     }
 }