Example #1
0
        static void beNotified(IntPtr notifyCode)
        {
            SCNotification nc = (SCNotification)Marshal.PtrToStructure(notifyCode, typeof(SCNotification));

            if (nc.nmhdr.code == (uint)NppMsg.NPPN_TBMODIFICATION)
            {
                PluginBase._funcItems.RefreshItems();
                PluginBase.SetToolBarIcon();
            }
            else if (nc.nmhdr.code == (uint)SciMsg.SCN_CHARADDED)
            {
                PluginBase.doInsertHtmlCloseTag((char)nc.ch);
            }
            else if (nc.nmhdr.code == (uint)NppMsg.NPPN_SHUTDOWN)
            {
                PluginBase.PluginCleanUp();
                Marshal.FreeHGlobal(_ptrPluginName);
            }
        }
Example #2
0
        private void SnippetInfo_MouseUp(object sender, MouseEventArgs e)
        {
            lock (this)
            {
                if (ManageMouseClickEvents)
                {
                    m_selected = !m_selected;
                    UpdateItemBackground();
                }
            }

            frmAddSnippet window = ClientUtils.PrepareViewSnippetForm(PluginBase.Current, SnippetId) as frmAddSnippet;

#if DOCKED
            PluginBase.OpenForm(window, PluginBase.VIEWSNIP_MENU_LABEL, PluginBase.ID_ADD_SNIPPET_CMD);
#else
            window.Show();
#endif
        }
Example #3
0
        private void publishw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            string errorMsg = e.Result as string;

            progressBar.Visible = false;

            if (string.IsNullOrEmpty(errorMsg))
            {
                ErrorTxt.Text    = string.Empty;
                ErrorTxt.Visible = false;

                // Close the window
                PluginBase.CloseForm(this);
            }
            else
            {
                ErrorTxt.Text    = errorMsg;
                ErrorTxt.Visible = true;
            }
            publishClicked = false;
        }
Example #4
0
        private void bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            AboutResultReport res = e.Result as AboutResultReport;

            progressBar.Visible = false;

            if (!res.newServer.Equals(res.oldServer, StringComparison.InvariantCultureIgnoreCase)) // we have changed something
            {
                User           us          = res.currentUser;
                IPluginManager thisPackage = PluginBase.Current;
                ClientUtils.CloseObsoleteFormsFromAbout(thisPackage);   // cleanup and close obsolete objects

                if ((us == null) || (us.ID <= 0))
                {
                    string errorMsg = res.error;
                    if (!errorMsg.IsNullOrWhiteSpaceOrEOF())
                    {
                        SetError(errorMsg); // only display the message
                    }
                    else
                    {
                        // invalid login on the new server!
                        ClientUtils.ManageInvalidLoginOnNewServerFromAbout(thisPackage, UserPlugin.Current,
                                                                           res.oldServer, res.newServer);

                        // Close the window
                        PluginBase.CloseForm(this);
                    }

                    UpdateClicked = false;
                    return;
                }

                // save new server path
                UserPlugin.Current.SaveUserPreferences();
            }
            UpdateClicked = false;
        }
Example #5
0
 static void setInfo(NppData notepadPlusData)
 {
     PluginBase.nppData = notepadPlusData;
     PluginBase.CommandMenuInit();
 }
Example #6
0
 public static void About()
 {
     PluginBase.About();
 }
Example #7
0
 public static void Login_Logout()
 {
     PluginBase.Login_Logout();
 }
Example #8
0
 public static void SearchSnippets()
 {
     PluginBase.SearchSnip();
 }
Example #9
0
 public static void AddSnippet()
 {
     PluginBase.AddSnip();
 }
Example #10
0
 public static void Init()
 {
     PluginBase.CommandMenuInit();
 }