Exemplo n.º 1
0
        public Task Initialize()
        {
            ISerializerService serializer = ConceptMatrix.Services.Get <ISerializerService>();

            string         json = File.ReadAllText("MainOffsets.json");
            MainOffsetFile file = serializer.Deserialize <MainOffsetFile>(json);

            // Set the names of all the offsets for debugging.
            PropertyInfo[] properties = file.GetType().GetProperties();
            foreach (PropertyInfo property in properties)
            {
                Offset offset = (Offset)property.GetValue(file);
                offset.Name = property.Name;
                property.SetValue(file, offset);
            }

            Offsets.Main = file;

            return(Task.CompletedTask);
        }