Exemple #1
0
        private void DBSetToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var dbConfig = SingletonHelper <DBConfig> .CreateInstance();

            dbConfig.ShowDialog();
            config = JsonHelper.ReadConfigJson();
        }
Exemple #2
0
        /// <summary>
        /// This function is the callback used to execute the command when the menu item is clicked.
        /// See the constructor to see how the menu item is associated with this function using
        /// OleMenuCommandService service and MenuCommand class.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        private void Execute(object sender, EventArgs e)
        {
            ThreadHelper.ThrowIfNotOnUIThread();
            string message = string.Format(CultureInfo.CurrentCulture, "Inside {0}.MenuItemCallback()", this.GetType().FullName);
            string title   = "Command";

            var mainForm = SingletonHelper <MainForm> .CreateInstance();

            mainForm.Show();

            // Show a message box to prove we were here
            //VsShellUtilities.ShowMessageBox(
            //    this.package,
            //    message,
            //    title,
            //    OLEMSGICON.OLEMSGICON_INFO,
            //    OLEMSGBUTTON.OLEMSGBUTTON_OK,
            //    OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);
        }
Exemple #3
0
 private void DbConfig_FormClosed(object sender, FormClosedEventArgs e)
 {
     SingletonHelper <DBConfig> .Dispose();
 }
Exemple #4
0
 private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     SingletonHelper <MainForm> .Dispose();
 }