Ejemplo n.º 1
0
 public void Save(IPersistStream stream)
 {
     stream.Save("name", _name);
     stream.Save("path", _path);
     if (_image != null)
     {
         stream.Save("image", MyFavorites.ImageToBase64String(_image, ImageFormat.Png));
     }
 }
Ejemplo n.º 2
0
            public void Load(IPersistStream stream)
            {
                _name = (string)stream.Load("name", String.Empty);
                _path = (string)stream.Load("path", String.Empty);

                if (_image != null)
                {
                    _image.Dispose();
                    _image = null;
                }
                string imageBase64 = (string)stream.Load("image", String.Empty);

                if (!String.IsNullOrEmpty(imageBase64))
                {
                    try
                    {
                        _image = MyFavorites.Base64StringToImage(imageBase64);
                    }
                    catch { }
                }
            }