Ejemplo n.º 1
0
        internal static void Deserialize(AnalyzerBase analyzer, Dictionary<string, object> fieldDict)
        {
            if (fieldDict == null || !fieldDict.Any())
                return;

            analyzer.Version = fieldDict.GetDoubleOrNull(_VERSION);
            if (fieldDict.ContainsKey(_ALIASES))
            {
                analyzer.Aliases = JsonConvert.DeserializeObject<IEnumerable<string>>(fieldDict.GetString(_ALIASES));
            }
        }
Ejemplo n.º 2
0
        internal static void Serialize(AnalyzerBase analyzer, Dictionary<string, object> fieldDict)
        {
            if (analyzer == null)
                return;

            if (fieldDict == null)
                fieldDict = new Dictionary<string, object>();

            fieldDict.Add(_TYPE, analyzer.Type.ToString());
            fieldDict.AddObject(_VERSION, analyzer.Version);
            if (analyzer.Aliases != null && analyzer.Aliases.Any())
            {
                fieldDict.Add(_ALIASES, analyzer.Aliases);
            }
        }