コード例 #1
0
 private static void CreateStickerIconElement(StickerIcon icon, JsonElementDict dict)
 {
     dict.SetString("size", string.Format("{0}x{1}", icon.size.x, icon.size.y));
     dict.SetString("idiom", icon.GetIdiom());
     dict.SetString("filename", icon.filename);
     dict.SetString("scale", icon.GetScale());
     if (!string.IsNullOrEmpty(icon.platform))
     {
         dict.SetString("platform", icon.platform);
     }
 }
コード例 #2
0
 protected void WriteRequirementsToJson(JsonElementDict item, DeviceRequirement req)
 {
     foreach (var kv in req.values)
     {
         if (kv.Value != null && kv.Value != "")
         {
             item.SetString(kv.Key, kv.Value);
         }
     }
 }
コード例 #3
0
        internal static string CreateJsonString(List <Icon> icons, bool prerendered)
        {
            JsonDocument document = new JsonDocument {
                indentString = "\t"
            };
            JsonElementArray array = document.root.CreateArray("images");

            foreach (Icon icon in icons)
            {
                JsonElementDict dict = array.AddDict();
                dict.SetString("size", $"{icon.width}x{icon.height}");
                dict.SetString("idiom", FileUpdaterUtils.GetDeviceIdiomForJson(icon.deviceType));
                dict.SetString("filename", icon.xcodefile);
                dict.SetString("scale", $"{icon.scale}x");
            }
            JsonElementDict dict2 = document.root.CreateDict("info");

            dict2.SetInteger("version", 1);
            dict2.SetString("author", "xcode");
            document.root.CreateDict("properties").SetBoolean("pre-rendered", prerendered);
            return(document.WriteToString());
        }
コード例 #4
0
        internal static string CreateJsonString(List <SplashScreen> splashes)
        {
            JsonDocument document = new JsonDocument {
                indentString = "\t"
            };
            JsonElementArray entries = document.root.CreateArray("images");

            foreach (SplashScreen screen in splashes)
            {
                AddSplashEntry(entries, screen);
            }
            JsonElementDict dict = document.root.CreateDict("info");

            dict.SetInteger("version", 1);
            dict.SetString("author", "xcode");
            return(document.WriteToString());
        }
コード例 #5
0
 private static void AddSplashEntryForOSVersion(JsonElementDict entry, SplashScreen splash, string minOsVersion)
 {
     entry.SetString("orientation", !splash.isPortrait ? "landscape" : "portrait");
     entry.SetString("idiom", FileUpdaterUtils.GetDeviceIdiomForJson(splash.deviceType));
     entry.SetString("filename", splash.xcodeFile);
     if (minOsVersion != null)
     {
         entry.SetString("minimum-system-version", splash.minOsVersion);
     }
     if (splash.subtype != null)
     {
         entry.SetString("subtype", splash.subtype);
     }
     entry.SetString("extent", "full-screen");
     entry.SetString("scale", $"{splash.scale}x");
 }