public static T Read <T>(this IMacroFeatureData macroFeatureData)
        {
            string data;

            macroFeatureData.GetStringByName(FeatureDataKey, out data);
            return(Json.FromJson <T>(data));
        }
Пример #2
0
        /// <summary>
        /// Json反序列化
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="macroFeatureData"></param>
        /// <returns></returns>
        public static T Read <T>(this IMacroFeatureData macroFeatureData)
        {
            string data;

            macroFeatureData.GetStringByName(FeatureDataKey, out data);
            return(JsonConvert.DeserializeObject <T>(data));
        }
Пример #3
0
        private Version GetVersion(IMacroFeatureData featData, string name)
        {
            Version dimsVersion;
            string  versVal;

            featData.GetStringByName(name, out versVal);

            if (!Version.TryParse(versVal, out dimsVersion))
            {
                dimsVersion = new Version();
            }

            return(dimsVersion);
        }