Exemplo n.º 1
0
        public static CalculationItem DeserializeCalculationItem(JObject json, CalculationGroupTable calculationGroupTable)
        {
            var tom = TOM.JsonSerializer.DeserializeObject <TOM.CalculationItem>(json.ToString());

            tom.Name = calculationGroupTable.CalculationItems.GetNewName(tom.Name);

            var calculationItem = CalculationItem.CreateFromMetadata(calculationGroupTable.CalculationGroup, tom);

            return(calculationItem);
        }
Exemplo n.º 2
0
        public static CalculationItem DeserializeCalculationItem(JObject json, CalculationGroupTable calculationGroupTable)
        {
            var tom = TOM.JsonSerializer.DeserializeObject <TOM.CalculationItem>(json.ToString(Formatting.None));

            tom.Name    = calculationGroupTable.CalculationItems.GetNewName(tom.Name);
            tom.Ordinal = calculationGroupTable.CalculationItems.Any(i => i.Ordinal != -1) ? calculationGroupTable.CalculationItems.Max(i => i.Ordinal) + 1 : -1;

            var calculationItem = CalculationItem.CreateFromMetadata(calculationGroupTable.CalculationGroup, tom);

            return(calculationItem);
        }