Esempio n. 1
0
        public static JSONObject CreateTestClassJson()
        {
            var retVal = new JSONObject
            {
                { "BInt", -1 },
                { "AInt", 1 },
                { "ALong", 1L },
                { "AFloat", 1f },
                { "ABool", true },
                { "AString", "AString" },
                { "AArray", new int[] { 0, 1, 2, 3 } },
                { "AList", new List <int> {
                      0, 1, 2, 3
                  } },
                { "ADict", new Dictionary <string, int> {
                      { "zero", 0 },
                      { "one", 1 },
                      { "two", 2 },
                      { "three", 3 }
                  } }
            };

            retVal["TestClassInstance"] = retVal.Clone();
            return(retVal);
        }
Esempio n. 2
0
 public static JSONObject GetCensoredData(JSONObject song, DateTime timeSince)
 {
     if (RequestBotConfig.Instance.MinimumUploadTimeCensor == -10 || RequestBotConfig.Instance.MinimumUploadTimeCensor >
         (timeSince - DateTime.Parse(song["createdAt"].Value).ToUniversalTime()).TotalMinutes)
     {
         var songcpy = song.Clone();
         songcpy["songName"]    = "***";
         songcpy["authorName"]  = "***";
         songcpy["songSubName"] = "***";
         return(songcpy.AsObject);
     }
     return(song);
 }