예제 #1
0
        public static T GetCustomSettings <T>(this SPListItem listItem, AIAPortalFeatures featureName, bool lookupInParent)
        {
            string strKey      = Utility.BuildKey <T>(featureName);
            string settingsXml = listItem.GetCustomProperty(strKey);

            //CCIUtility.LogError(settingsXml, CCIappFeatureNames.CCIappEEC);
            if (!string.IsNullOrEmpty(settingsXml))
            {
                return((T)SerializationHelper.DeserializeFromXml <T>(settingsXml));
            }

            if (!lookupInParent)
            {
                return(default(T));
            }

            T objReturn = default(T);

            if (listItem.ContentType != null)
            {
                objReturn = listItem.ContentType.GetCustomSettings <T>(featureName);
            }

            return(objReturn);
        }