Esempio n. 1
0
        public void Load(ZipArchive iArchive)
        {
            JObject         pJOtImages = null;
            ZipArchiveEntry pZAEImages = iArchive.GetEntry("images.json");

            if (pZAEImages != null)
            {
                using (Stream pStmImages = pZAEImages.Open())
                {
                    using (StreamReader pSRrReader = new StreamReader(pStmImages, Encoding.UTF8, false, 1024, true))
                    {
                        using (JsonTextReader pJTRReader = new JsonTextReader(pSRrReader))
                        {
                            pJOtImages = JObject.Load(pJTRReader);
                        }
                    }
                }
            }

            JArray pJAyImages = pJOtImages["images"].Value <JArray>();;

            foreach (JObject curImage in pJAyImages)
            {
                ProjectImage    pPIeImage = ProjectImage.FromJSON(curImage);
                ZipArchiveEntry pZAEImage = iArchive.GetEntry(pPIeImage.ID);
                if (pZAEImage != null)
                {
                    using (Stream pStmImage = pZAEImage.Open())
                    {
                        pPIeImage.Image = Image.FromStream(pStmImage);
                        cDicImages.Add(pPIeImage.ID, pPIeImage);
                    }
                }
            }
        }
Esempio n. 2
0
        public static ProjectImage FromJSON(JObject iJSON)
        {
            ProjectImage pPIeImage = new ProjectImage(iJSON["ID"].Value <String>(),
                                                      iJSON["Name"].Value <String>());

            return(pPIeImage);
        }
Esempio n. 3
0
 public ProjectImage AddImage(String iName,
     Image iImage)
 {
     ProjectImage pPIeImage = new ProjectImage(iName, iImage);
     cDicImages.Add(pPIeImage.ID, pPIeImage);
     NotifyPropertyChanged("Images");
     return (pPIeImage);
 }
Esempio n. 4
0
        public ProjectImage AddImage(String iName,
                                     Image iImage)
        {
            ProjectImage pPIeImage = new ProjectImage(iName, iImage);

            cDicImages.Add(pPIeImage.ID, pPIeImage);
            NotifyPropertyChanged("Images");
            return(pPIeImage);
        }
Esempio n. 5
0
 public static ProjectImage FromJSON(JObject iJSON)
 {
     ProjectImage pPIeImage = new ProjectImage(iJSON["ID"].Value<String>(),
         iJSON["Name"].Value<String>());
     return (pPIeImage);
 }