/// <summary> /// Configures the environment to load the plugin manager and verify we /// have access to the ImmediateCorrectionPlugin. /// </summary> private void SetupCorrectionPlugin( out BlockCommandContext context, out ProjectBlockCollection blocks, out BlockCommandSupervisor commands, out ImmediateCorrectionProjectPlugin projectPlugin) { // Start getting us a simple plugin manager. var plugin = new ImmediateCorrectionPlugin(); var pluginManager = new PluginManager(plugin); PluginManager.Instance = pluginManager; // Create a project and pull out the useful properties we'll use to // make changes. var project = new Project(); context = new BlockCommandContext(project); blocks = project.Blocks; commands = project.Commands; // Load in the immediate correction editor. if (!project.Plugins.Add("Immediate Correction")) { // We couldn't load it for some reason. throw new ApplicationException("Cannot load immediate correction plugin"); } // Pull out the controller for the correction and cast it (since we know // what type it is). ProjectPluginController pluginController = project.Plugins.Controllers[0]; projectPlugin = (ImmediateCorrectionProjectPlugin)pluginController.ProjectPlugin; }
/// <summary> /// Configures the environment to load the plugin manager and verify we /// have access to the ImmediateCorrectionPlugin. /// </summary> private void SetupCorrectionPlugin( out BlockCommandContext context, out ProjectBlockCollection blocks, out BlockCommandSupervisor commands, out ImmediateCorrectionProjectPlugin projectPlugin) { // Start getting us a simple plugin manager. var plugin = new ImmediateCorrectionPlugin(); var pluginManager = new PluginManager(plugin); PluginManager.Instance = pluginManager; // Create a project and pull out the useful properties we'll use to // make changes. var project = new Project(); context = new BlockCommandContext(project); blocks = project.Blocks; commands = project.Commands; // Load in the immediate correction editor. if (!project.Plugins.Add("Immediate Correction")) { // We couldn't load it for some reason. throw new ApplicationException("Cannot load immediate correction plugin"); } // Pull out the controller for the correction and cast it (since we know // what type it is). ProjectPluginController pluginController = project.Plugins.Controllers[0]; projectPlugin = (ImmediateCorrectionProjectPlugin) pluginController.ProjectPlugin; }