public static Element Read(StreamReader stream)
 {
     Element res = new Element {Identifier = StreamParser.GetString(stream)};
     int tagCount = StreamParser.GetInt(stream);
     for (int i = 0; i < tagCount; i++)
     {
         string tagName = StreamParser.GetString(stream);
         int tagType = StreamParser.GetInt(stream);
         switch (tagType)
         {
             case 0: {
                 res.Tags.Add(tagName, new Tag(StreamParser.GetString(stream)));
                 break;
             }
             case 1:
             {
                 res.Tags.Add(tagName, new Tag(StreamParser.GetInt(stream)));
                 break;
             }
             case 2:
             {
                 res.Tags.Add(tagName, new Tag(StreamParser.GetBool(stream)));
                 break;
             }
         }
     }
     return res;
 }
 public void AddPicture(string path)
 {
     Bitmap image = new Bitmap(path);
     Element elem = new Element {Identifier = Path.GetFileName(path)};
     elem.Tags.Add("NAME", new Tag(elem.Identifier));
     Data.Add(elem);
     elem.SavePictureData(CacheFolder, image);
 }