Exemple #1
0
 private SettingJsonNode(SettingJsonNode node, SettingTranslateJsonNode translateNode)
     : base(node.Key)
 {
     if (!node.IsKeyEqual(translateNode.Key))
     {
         throw new InvalidOperationException($"translate node key {translateNode.Key} is not equal to {node.Key}");
     }
     if ((node.Values.List == null || node.Values.List.Length == 0) && translateNode.Values != null)
     {
         throw new InvalidOperationException($"translate node {translateNode.Key} should not contains values");
     }
     Name        = translateNode.Name;
     Category    = node.Category;
     Description = translateNode.Description ?? node.Description;
     Values      = node.Values.TranslateWith(translateNode.Values);
 }
Exemple #2
0
 public SettingJsonNode TranslateWith(SettingTranslateJsonNode translateNode) =>
 new SettingJsonNode(this, translateNode);