public static object GetDefaultConfig(this ITopbarCommand command) { return(GetCommandConfigDataFile(command).Read(command.ConfigType) ?? Activator.CreateInstance(command.ConfigType)); }
public static void UpdateDefaultCommandConfig(this ITopbarCommand command, object config) { GetCommandConfigDataFile(command).Write(config); }
static DataFile GetCommandConfigDataFile(this ITopbarCommand command) { return(DataFolders.Shared.GetFolder("Topbar/Commands").GetFile(command.Name + ".config", DataFileFormats.TypedJson)); }