using Microsoft.Xna.Framework.Content.Pipeline; using Newtonsoft.Json; using System.IO; namespace RecrownedAthenaeum.Pipeline.NinePatch { [ContentImporter(".9p", DisplayName = "Nine Patch Importer", DefaultProcessor = "NinePatchProcessor")] internal class NinePatchImporter : ContentImporter { public override NinePatchData Import(string filename, ContentImporterContext context) { NinePatchData data; using (StreamReader stream = new StreamReader(filename)) { data = JsonConvert.DeserializeObject(stream.ReadToEnd()); } context.AddDependency(data.textureName); return data; } } }