예제 #1
0
 public PictogramType(piktogramy pikt)
 {
     Name = pikt.name;
     try
     {
         Categories = new CategoryType(pikt.category.name);
     }
     catch (Exception e)
     {
     }
     using (var stream = new MemoryStream(pikt.image))
     {
         JpegBitmapDecoder decoder = new JpegBitmapDecoder(stream,
                                         BitmapCreateOptions.PreservePixelFormat,
                                         BitmapCacheOption.OnLoad);
         BitmapSource bitmapSource = decoder.Frames[0];
         bitmapSource.Freeze();
         Image = bitmapSource;
     }
     Medium = System.Text.Encoding.ASCII.GetString(pikt.medium.@object);
     MediumType = (MediaTypeEnum)pikt.media_id;
 }
 internal void EditCategory()
 {
     db.EditCategory((int)(db.GetCategory(currentCategory.Name).id), CategoryName);
     currentCategory = new CategoryType(CategoryName);
 }