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; }
public void SetAdditionalProperty(BookType type) { SpecializedCollection<string, string> additionalPropertyCollection = new SpecializedCollection<string, string>(); additionalPropertyCollection.Add(type.Theme, type.Property); OtherPropertiesJSON = JsonConvert.SerializeObject(additionalPropertyCollection); }