public void __beNotified(SCNotification notifyCode)
 {
     if (notifyCode.nmhdr.code == (uint)NppMsg.NPPN_SHUTDOWN)
     {
         PluginCleanUp();
     }
     else if (notifyCode.nmhdr.code == (uint)NppMsg.NPPN_TBMODIFICATION)
     {
         SetToolBarIcon();
     }
 }
        public void __beNotified(SCNotification notifyCode)
        {
            if (notifyCode.nmhdr.code == (uint)NppMsg.NPPN_SHUTDOWN)
            {
                PluginCleanUp();
            }
            else if (notifyCode.nmhdr.code == (uint)NppMsg.NPPN_TBMODIFICATION)
            {
                SetToolBarIcon();
            }
            //else if (notifyCode.nmhdr.code == (uint)SciMsg.SCN_CHARADDED)
            //{
            //    doInsertHtmlCloseTag((char)notifyCode.ch);
            //}
            else if (notifyCode.nmhdr.code == (uint)NppMsg.NPPN_READY)
            {
                _readySignalReceived = true;

                _currentFile = GetOpenFileFullPath();
                SendParseMessage(_currentFile);
                //logToText("_readySignalReceived");
            }
            else if (notifyCode.nmhdr.code == (uint)NppMsg.NPPN_BUFFERACTIVATED)
            {
                if (!_readySignalReceived)
                    return;
                //logToText("NPPN_BUFFERACTIVATED");
                string bufferFile = GetOpenFileFullPath();
                if (_currentFile != GetOpenFileFullPath())
                {
                    _currentFile = bufferFile;
                    SendParseMessage(_currentFile);
                }

                //StringBuilder path = new StringBuilder(Win32.MAX_PATH);
                //Win32.SendMessage(nppData._nppHandle, NppMsg.NPPM_GETFILENAME, 0, path);

            }
            else if (notifyCode.nmhdr.code == (uint)NppMsg.NPPN_FILEOPENED)
            {
                if (_frmPlsqlObjects == null || !_frmPlsqlObjects.Visible)
                    return;
                if (!_readySignalReceived)
                    return;

                _currentFile = GetOpenFileFullPath();

                SendParseMessage(_currentFile);
            }
        }
 public void __beNotified(SCNotification notifyCode)
 {
     if (notifyCode.nmhdr.code == (uint)NppMsg.NPPN_SHUTDOWN)
     {
         PluginCleanUp();
     }
     else if (notifyCode.nmhdr.code == (uint)NppMsg.NPPN_TBMODIFICATION)
     {
         SetToolBarIcon();
     }
     else if (notifyCode.nmhdr.code == (uint)SciMsg.SCN_CHARADDED)
     {
         CharAdded((char)notifyCode.ch);
     }
 }
 void NppPluginNETEventbus_OnNPPN_TBMODIFICATION(SCNotification scnNotification)
 {
     toolbarIcons tbIcons = new toolbarIcons();
     tbIcons.hToolbarBmp = tbBmp.GetHbitmap();
     IntPtr pTbIcons = Marshal.AllocHGlobal(Marshal.SizeOf(tbIcons));
     Marshal.StructureToPtr(tbIcons, pTbIcons, false);
     Win32.SendMessage(PluginBase.nppData._nppHandle, NppMsg.NPPM_ADDTOOLBARICON, this.id, pTbIcons);
     Marshal.FreeHGlobal(pTbIcons);
 }
 internal static void Process(SCNotification nc)
 {
     switch (nc.nmhdr.code)
     {
         case (uint)SciMsg.SCN_CHARADDED:
             if (CharAdded != null)
                 CharAdded(nc);
             break;
     }
 }
        internal static void Process(SCNotification nc)
        {
            switch(nc.nmhdr.code)
            {
                case (uint)NppMsg.NPPN_DOCORDERCHANGED:
                    if (DocOrderChanged != null)
                        DocOrderChanged(nc);
                    break;

                case (uint)NppMsg.NPPN_FILEBEFORELOAD:
                    if (FileBeforeLoad != null)
                        FileBeforeLoad(nc);
                    break;

                case (uint)NppMsg.NPPN_SHORTCUTREMAPPED:
                    if (ShortcutRemapped != null)
                        ShortcutRemapped(nc);
                    break;

                case (uint)NppMsg.NPPN_WORDSTYLESUPDATED:
                    if (WordStylesUpdated != null)
                        WordStylesUpdated(nc);
                    break;

                case (uint)NppMsg.NPPN_LANGCHANGED:
                    if (LangChanged != null)
                        LangChanged(nc);
                    break;

                case (uint)NppMsg.NPPN_BUFFERACTIVATED:
                    if (BufferActivated != null)
                        BufferActivated(nc);
                    break;

                case (uint)NppMsg.NPPN_FILEBEFORESAVE:
                    if (FileSaved != null)
                        FileSaved(nc);
                    break;

                case (uint)NppMsg.NPPN_FILEOPENED:
                    if (FileOpened != null)
                        FileOpened(nc);
                    break;

                case (uint)NppMsg.NPPN_FILEBEFOREOPEN:
                    if (FileBeforeOpen != null)
                        FileBeforeOpen(nc);
                    break;

                case (uint)NppMsg.NPPN_FILECLOSED:
                    if (FileClosed != null)
                        FileClosed(nc);
                    break;

                case (uint)NppMsg.NPPN_TBMODIFICATION:
                    if (TBModification != null)
                        TBModification(nc);
                    break;

                case (uint)NppMsg.NPPN_READY:
                    if (Ready != null)
                        Ready(nc);
                    break;

                case (uint)NppMsg.NPPN_SHUTDOWN:
                    if (Shutdown != null)
                        Shutdown(nc);
                    break;

                case (uint)NppMsg.NPPN_FILEBEFORECLOSE:
                    if (FileBeforeClose != null)
                        FileBeforeClose(nc);
                    break;
            }
        }
        public static void _triggerevent(SCNotification nc)
        {
            if (OnNPPN_CATCHALL != null)
                OnNPPN_CATCHALL(nc);

            switch (nc.nmhdr.code) {
                #region AUTO

                case (uint)NppMsg.NPPN_READY:
                    if (OnNPPN_READY != null)
                        OnNPPN_READY(nc);
                    break;
                case (uint)NppMsg.NPPN_TBMODIFICATION:
                    if (OnNPPN_TBMODIFICATION != null)
                        OnNPPN_TBMODIFICATION(nc);
                    break;
                case (uint)NppMsg.NPPN_FILEBEFORECLOSE:
                    if (OnNPPN_FILEBEFORECLOSE != null)
                        OnNPPN_FILEBEFORECLOSE(nc);
                    break;
                case (uint)NppMsg.NPPN_FILEOPENED:
                    if (OnNPPN_FILEOPENED != null)
                        OnNPPN_FILEOPENED(nc);
                    break;
                case (uint)NppMsg.NPPN_FILECLOSED:
                    if (OnNPPN_FILECLOSED != null)
                        OnNPPN_FILECLOSED(nc);
                    break;
                case (uint)NppMsg.NPPN_FILEBEFOREOPEN:
                    if (OnNPPN_FILEBEFOREOPEN != null)
                        OnNPPN_FILEBEFOREOPEN(nc);
                    break;
                case (uint)NppMsg.NPPN_FILEBEFORESAVE:
                    if (OnNPPN_FILEBEFORESAVE != null)
                        OnNPPN_FILEBEFORESAVE(nc);
                    break;
                case (uint)NppMsg.NPPN_FILESAVED:
                    if (OnNPPN_FILESAVED != null)
                        OnNPPN_FILESAVED(nc);
                    break;
                case (uint)NppMsg.NPPN_SHUTDOWN:
                    if (OnNPPN_SHUTDOWN != null)
                        OnNPPN_SHUTDOWN(nc);
                    break;
                case (uint)NppMsg.NPPN_BUFFERACTIVATED:
                    if (OnNPPN_BUFFERACTIVATED != null)
                        OnNPPN_BUFFERACTIVATED(nc);
                    break;
                case (uint)NppMsg.NPPN_LANGCHANGED:
                    if (OnNPPN_LANGCHANGED != null)
                        OnNPPN_LANGCHANGED(nc);
                    break;
                case (uint)NppMsg.NPPN_WORDSTYLESUPDATED:
                    if (OnNPPN_WORDSTYLESUPDATED != null)
                        OnNPPN_WORDSTYLESUPDATED(nc);
                    break;
                case (uint)NppMsg.NPPN_SHORTCUTREMAPPED:
                    if (OnNPPN_SHORTCUTREMAPPED != null)
                        OnNPPN_SHORTCUTREMAPPED(nc);
                    break;
                case (uint)NppMsg.NPPN_FILEBEFORELOAD:
                    if (OnNPPN_FILEBEFORELOAD != null)
                        OnNPPN_FILEBEFORELOAD(nc);
                    break;
                case (uint)NppMsg.NPPN_FILELOADFAILED:
                    if (OnNPPN_FILELOADFAILED != null)
                        OnNPPN_FILELOADFAILED(nc);
                    break;
                case (uint)NppMsg.NPPN_READONLYCHANGED:
                    if (OnNPPN_READONLYCHANGED != null)
                        OnNPPN_READONLYCHANGED(nc);
                    break;
                case (uint)NppMsg.NPPN_DOCORDERCHANGED:
                    if (OnNPPN_DOCORDERCHANGED != null)
                        OnNPPN_DOCORDERCHANGED(nc);
                    break;
                case (uint)SciMsg.SCN_STYLENEEDED:
                    if (OnSCN_STYLENEEDED != null)
                        OnSCN_STYLENEEDED(nc);
                    break;
                case (uint)SciMsg.SCN_CHARADDED:
                    if (OnSCN_CHARADDED != null)
                        OnSCN_CHARADDED(nc);
                    break;
                case (uint)SciMsg.SCN_SAVEPOINTREACHED:
                    if (OnSCN_SAVEPOINTREACHED != null)
                        OnSCN_SAVEPOINTREACHED(nc);
                    break;
                case (uint)SciMsg.SCN_SAVEPOINTLEFT:
                    if (OnSCN_SAVEPOINTLEFT != null)
                        OnSCN_SAVEPOINTLEFT(nc);
                    break;
                case (uint)SciMsg.SCN_MODIFYATTEMPTRO:
                    if (OnSCN_MODIFYATTEMPTRO != null)
                        OnSCN_MODIFYATTEMPTRO(nc);
                    break;
                case (uint)SciMsg.SCN_KEY:
                    if (OnSCN_KEY != null)
                        OnSCN_KEY(nc);
                    break;
                case (uint)SciMsg.SCN_DOUBLECLICK:
                    if (OnSCN_DOUBLECLICK != null)
                        OnSCN_DOUBLECLICK(nc);
                    break;
                case (uint)SciMsg.SCN_UPDATEUI:
                    if (OnSCN_UPDATEUI != null)
                        OnSCN_UPDATEUI(nc);
                    break;
                case (uint)SciMsg.SCN_MODIFIED:
                    if (OnSCN_MODIFIED != null)
                        OnSCN_MODIFIED(nc);
                    break;
                case (uint)SciMsg.SCN_MACRORECORD:
                    if (OnSCN_MACRORECORD != null)
                        OnSCN_MACRORECORD(nc);
                    break;
                case (uint)SciMsg.SCN_MARGINCLICK:
                    if (OnSCN_MARGINCLICK != null)
                        OnSCN_MARGINCLICK(nc);
                    break;
                case (uint)SciMsg.SCN_NEEDSHOWN:
                    if (OnSCN_NEEDSHOWN != null)
                        OnSCN_NEEDSHOWN(nc);
                    break;
                case (uint)SciMsg.SCN_PAINTED:
                    if (OnSCN_PAINTED != null)
                        OnSCN_PAINTED(nc);
                    break;
                case (uint)SciMsg.SCN_USERLISTSELECTION:
                    if (OnSCN_USERLISTSELECTION != null)
                        OnSCN_USERLISTSELECTION(nc);
                    break;
                case (uint)SciMsg.SCN_URIDROPPED:
                    if (OnSCN_URIDROPPED != null)
                        OnSCN_URIDROPPED(nc);
                    break;
                case (uint)SciMsg.SCN_DWELLSTART:
                    if (OnSCN_DWELLSTART != null)
                        OnSCN_DWELLSTART(nc);
                    break;
                case (uint)SciMsg.SCN_DWELLEND:
                    if (OnSCN_DWELLEND != null)
                        OnSCN_DWELLEND(nc);
                    break;
                case (uint)SciMsg.SCN_ZOOM:
                    if (OnSCN_ZOOM != null)
                        OnSCN_ZOOM(nc);
                    break;
                case (uint)SciMsg.SCN_HOTSPOTCLICK:
                    if (OnSCN_HOTSPOTCLICK != null)
                        OnSCN_HOTSPOTCLICK(nc);
                    break;
                case (uint)SciMsg.SCN_HOTSPOTDOUBLECLICK:
                    if (OnSCN_HOTSPOTDOUBLECLICK != null)
                        OnSCN_HOTSPOTDOUBLECLICK(nc);
                    break;
                case (uint)SciMsg.SCN_CALLTIPCLICK:
                    if (OnSCN_CALLTIPCLICK != null)
                        OnSCN_CALLTIPCLICK(nc);
                    break;
                case (uint)SciMsg.SCN_AUTOCSELECTION:
                    if (OnSCN_AUTOCSELECTION != null)
                        OnSCN_AUTOCSELECTION(nc);
                    break;
                case (uint)SciMsg.SCN_INDICATORCLICK:
                    if (OnSCN_INDICATORCLICK != null)
                        OnSCN_INDICATORCLICK(nc);
                    break;
                case (uint)SciMsg.SCN_INDICATORRELEASE:
                    if (OnSCN_INDICATORRELEASE != null)
                        OnSCN_INDICATORRELEASE(nc);
                    break;
                case (uint)SciMsg.SCN_AUTOCCANCELLED:
                    if (OnSCN_AUTOCCANCELLED != null)
                        OnSCN_AUTOCCANCELLED(nc);
                    break;
                case (uint)SciMsg.SCN_AUTOCCHARDELETED:
                    if (OnSCN_AUTOCCHARDELETED != null)
                        OnSCN_AUTOCCHARDELETED(nc);
                    break;
                case (uint)SciMsg.SCN_SCROLLED:
                    if (OnSCN_SCROLLED != null)
                        OnSCN_SCROLLED(nc);
                    break;

                #endregion
                default:
                    if (OnNPPN_UNKNOWNMSG != null)
                        OnNPPN_UNKNOWNMSG(nc);
                    break;
            }
        }