private void btnOK_Click(object sender, EventArgs e) { if (Directory.Exists(tbxPathToGuide.Text)) { var guideExe = Directory.GetFiles(tbxPathToGuide.Text, "guide?.exe").SingleOrDefault(); if (guideExe != null) { tbxPathToGuide.Text += guideExe; } } if (!File.Exists(tbxPathToGuide.Text)) { MessageBox.Show(this, string.Format(m_ParentAddin.GetResourceString(OWGuide.OWGuideCouldNotFindPath, "Could not find path '{0}'"), tbxPathToGuide.Text), m_ParentAddin.GetResourceString(OWGuide.OWGuideAddinName, "OW Guide Add-in"), MessageBoxButtons.OK, MessageBoxIcon.Error); tbxPathToGuide.Focus(); return; } GuideConfig.GuidePath = tbxPathToGuide.Text; GuideConfig.GuideConfiguration = tbxGuideConfig.Text; GuideConfig.CommandLineArguments = tbxAdditionalArguments.Text; GuideConfig.AlwaysNewInstance = cbxAlwaysInNewInstance.Checked; GuideConfig.SaveRegistryConfig(); Close(); }
public guideFrmConfig(OWGuide parentAddin) { m_ParentAddin = parentAddin; InitializeComponent(); GuideConfig.LoadRegistryConfig(); tbxPathToGuide.Text = GuideConfig.GuidePath; tbxGuideConfig.Text = GuideConfig.GuideConfiguration; tbxAdditionalArguments.Text = GuideConfig.CommandLineArguments; cbxAlwaysInNewInstance.Checked = GuideConfig.AlwaysNewInstance; }
void IOWAddin.InitializeAddin(IOWHost hostInfo) { m_HostInfo = hostInfo; m_ResourceProvider = hostInfo as IOWResourceProvider; GuideConfig.LoadRegistryConfig(); SetLanguage(m_HostInfo.CurrentLanguage); ADDIN_ACTIONS = new OWAddinAction[] { new OWAddinAction(START_GUIDE, GetResourceString(OWGuideStartGuide, "Show Event in Guide"), OWAddinActionType.SelectedEventAction, Properties.Resources.Details.ToBitmap()), new OWAddinAction(CHANGE_LANGUAGE, "Language Change", OWAddinActionType.EventReceiver, null), }; }