Example #1
0
 internal override JsonPrimitive ExecuteE(JsonPrimitive jp, JsonValue json, JsonValue parent)
 {
     if (json == null)
     {
         if (Config.Debug)
         {
             Console.WriteLine("[ERROR] Cannot rename something outside a dictionary");
         }
         return(jp);
     }
     WokeJ.AddKeyValue(json, KeyNew, jp);
     return(null);
 }
Example #2
0
        internal override bool ExecuteB(JsonObject json, JsonObject parent)
        {
            JsonValue old = WokeJ.GetElementByKey(json, Key);
            JsonValue neu = WokeJ.GetElementByKey(parent, ParentKey);

            if (neu != null)
            {
                WokeJ.AddKeyValue(json, Key, neu);
                return(WokeJ.GetElementByKey(json, Key) != old);
            }
            else
            {
                return(false);
            }
        }
Example #3
0
        internal override bool ExecuteB(JsonObject json, JsonObject parent)
        {
            if (json == null)
            {
                if (Config.Debug)
                {
                    Console.WriteLine("[ERROR] Cannot rename something outside a dictionary");
                }
                return(false);
            }
            var old = WokeJ.GetElementByKey(json, KeyOld);

            if (old == null)
            {
                return(false);
            }
            WokeJ.AddKeyValue(json, KeyNew, old);
            json.Remove(KeyOld);
            return(true); // overapptoximation
        }