Пример #1
0
 private InfoFile GetInfoFile(string pathC)
 {
     if (!Dic.ContainsKey(pathC))
     {
         Dic.Add(pathC, "InfoFolder\\" + DateTime.Now.Ticks.ToString());
         SaveDic();
         InfoFile file = new InfoFile(new FileInfo(pathC));
         file.Serialize(new FileInfo(Dic[pathC]));
         return(file);
     }
     else
     {
         return(InfoFile.Parse(Dic[pathC]));
     }
 }
Пример #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            FileInfo   info   = new FileInfo("testinfo");
            FileStream writer = info.Create();

            byte[] buffer = InfoFile.TEST_VALUE.Serialize();
            writer.Write(buffer, 0, buffer.Length);
            writer.Close();

            InfoFile infoFile2 = InfoFile.Parse(info.FullName);

            MessageBox.Show("My First Test Text\n" + (infoFile2.HasInfo("My First Test Text") ? infoFile2.GetInfo("My First Test Text").ToString() : "Null"));
            dynamic pic = infoFile2.GetInfo("FirstPic");

            pictureBox1.Image = pic.ToImage();
            MessageBox.Show(infoFile2.GetInfo("My First Test Text").Metadata[BaseInfoType.UPDATE_TIME].ToString());
            MessageBox.Show(infoFile2.GetInfo("Test Collection").ToString());
        }