/// <summary> /// Initialize Macro Editor Form /// </summary> /// <param name="externalIntegrationService">The External Integration Service</param> /// <param name="sourceMacro">The Source Macro</param> public MacroEditorForm(IExternalIntegrationService externalIntegrationService, Model.Macro.Macro sourceMacro) { try { InitializeComponent(); SourceMacro = sourceMacro ?? throw new ArgumentNullException("macro"); _externalIntegrationService = externalIntegrationService ?? throw new ArgumentNullException("externalIntegrationService"); //TODO: Adjust this, this is a band-aid /* * Moving to a model where multiple external providers are go be supported, and * at the current state, this form is no longer adequate. So for the moment, this * component is being forced in as the first provider to allow macro code generation * when switching between designer and source. * * Once the external push integration is finally re-inabled, this will be less important, a * and the form will only be concerned with modifying the intent model. * * Though there will likely be a live update feature, and at that point the intended target will * be selected by a drop down or another similar widget. */ ExternalProvider = _externalIntegrationService.GetInstalledProviders().FirstOrDefault(); if (ExternalProvider == null) { throw new ApplicationException("External Provider Not Installed"); } } catch (Exception caught) { logger.Error("Unexpected Error Initializing Macro Editor Form", caught); throw; } }
/// <summary> /// The Import Form /// </summary> /// <param name="externalIntegrationService">The External Integration Service</param> public ImportForm(IExternalIntegrationService externalIntegrationService) { try { InitializeComponent(); _externalIntegrationService = externalIntegrationService; } catch (Exception caught) { logger.Error("Unexpected Error Initializing Import Form", caught); throw; } }
/// <summary> /// Initialize Navigation TreeView /// </summary> /// <param name="labelManagementService">Injected Label Management Service</param> /// <param name="macroManagementService">Injected Macro Management Service</param> /// <param name="externalIntegrationService">Injected External Integration Service</param> public NavigationTreeView(ILabelManagementService labelManagementService, IMacroManagementService macroManagementService, IExternalIntegrationService externalIntegrationService) { try { InitializeComponent(); _labelManagementService = labelManagementService; _macroManagementService = macroManagementService; _externalIntegrationService = externalIntegrationService; } catch (Exception caught) { logger.Error("Unexpected Error Initializing Navigation TreeView", caught); throw; } }
/// <summary> /// Initialize MainForm /// </summary> /// <param name="navigationTreeView">Injected Navigation TreeView</param> /// <param name="macrosListView">Injected Macros ListView</param> /// <param name="externalIntegrationService">Injected External Integration Service Handle</param> public MainForm(Controls.NavigationTreeView navigationTreeView, Controls.MacrosListView macrosListView, IExternalIntegrationService externalIntegrationService) { try { _externalIntegrationService = externalIntegrationService; NavigationTreeView = navigationTreeView; MacrosListView = macrosListView; AssembleUI(); } catch (Exception caught) { logger.Error("Unexpected Error Initializing MainForm", caught); throw; } }
/// <summary> /// Initialize Macro Editor Form /// </summary> /// <param name="externalIntegrationService">The External Integration Service</param> public MacroEditorForm(IExternalIntegrationService externalIntegrationService) : this(externalIntegrationService, new Model.Macro.Macro()) { }