static public ContentData ModifiedDataForSave(ContentData cData, bool IsDownloadAll)
    {
        ContentData toSave = ContentData.Clone(cData);

        toSave.imgthumbnail = GetFileName(cData.imgthumbnail);
        if (toSave.img != null)
        {
            for (int i = 0; i < toSave.img.Length; i++)
            {
                toSave.img [i] = GetFileName(cData.img[i]);
            }
        }
        if (IsDownloadAll)
        {
            if (cData.pdfurl != "")
            {
                toSave.pdfurl = "file://" + System.IO.Path.Combine(Application.persistentDataPath, GetFileName(cData.pdfurl));
            }
            if (cData.vdourl != "")
            {
                toSave.vdourl = "file://" + System.IO.Path.Combine(Application.persistentDataPath, GetFileName(cData.vdourl));
            }
        }
        return(toSave);
    }
    static public ContentData ModifiedDataForLoad(ContentData cData)
    {
        ContentData toLoad = ContentData.Clone(cData);

        toLoad.imgthumbnail = System.IO.Path.Combine(Application.persistentDataPath, cData.imgthumbnail);
        for (int i = 0; (toLoad.img != null) && (i < toLoad.img.Length); i++)
        {
            toLoad.img [i] = System.IO.Path.Combine(Application.persistentDataPath, cData.img[i]);
        }
        return(toLoad);
    }
Exemple #3
0
        public void Should_clone_named_value_and_also_children()
        {
            var source = new ContentData
            {
                ["field1"] = new ContentFieldData(),
                ["field2"] = new ContentFieldData()
            };

            var clone = source.Clone();

            Assert.NotSame(source, clone);

            foreach (var(key, value) in clone)
            {
                Assert.NotSame(value, source[key]);
            }
        }