Exemplo n.º 1
0
Arquivo: Disc.cs Projeto: ruvor/Atapy
 public string RecMedia(MediaType type, List<string> media)
 {
     try
     {
         if ((Marshal.SizeOf(media) + Marshal.SizeOf(OtherPropertiesJSON)) > size)
         {
             throw new Exception { Source = "Не достаточно места на диске" };
         }
     }
     catch (Exception e)
     {
         return e.Source;
     }
     SpecializedCollection<MediaType, List<string>> additionalPropertyCollection = new SpecializedCollection<MediaType, List<string>>();
     additionalPropertyCollection.Add(type, media);
     OtherPropertiesJSON = JsonConvert.SerializeObject(additionalPropertyCollection);
     return null;
 }
Exemplo n.º 2
0
Arquivo: Book.cs Projeto: ruvor/Atapy
 public void SetAdditionalProperty(BookType type)
 {
     SpecializedCollection<string, string> additionalPropertyCollection = new SpecializedCollection<string, string>();
     additionalPropertyCollection.Add(type.Theme, type.Property);
     OtherPropertiesJSON = JsonConvert.SerializeObject(additionalPropertyCollection);
 }