示例#1
0
文件: Disc.cs 项目: 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;
 }
示例#2
0
文件: Book.cs 项目: 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);
 }