Ejemplo n.º 1
0
        static void beNotified(IntPtr notifyCode)
        {
            try
            {
                SCNotification nc = (SCNotification)Marshal.PtrToStructure(notifyCode, typeof(SCNotification));

                //File.AppendAllLines(Path.Combine(Path.GetTempPath(), "npp_logevent.log"), new[]
                //{
                //    nc.nmhdr.code + ":" + nc.lParam + "," + nc.wParam
                //});

                StringBuilder resultFileName = new StringBuilder(Win32.MAX_PATH);
                Win32.SendMessage(PluginBase.nppData._nppHandle, NppMsg.NPPM_GETFILENAME, Win32.MAX_PATH, resultFileName);

                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);
                }
                else if (nc.nmhdr.code == (uint)NppMsg.NPPN_FILESAVED)
                {
                    PluginBase.OnFileSaved();
                }
                else if (nc.nmhdr.code == (uint)NppMsg.NPPN_BUFFERACTIVATED)
                {
                    PluginBase.OnFileChanged();
                }
            }
            catch (Exception ex)
            {
                File.AppendAllLines(Path.Combine(Path.GetTempPath(), "npp_logevent.log"), new[]
                {
                    "ERROR: " + ex.Message + " " + ex.StackTrace
                });
            }
        }
Ejemplo n.º 2
0
 static void setInfo(NppData notepadPlusData)
 {
     PluginBase.nppData = notepadPlusData;
     PluginBase.CommandMenuInit();
 }
Ejemplo n.º 3
0
 public void SetFocus()
 {
     PluginBase.SetFocus();
 }
Ejemplo n.º 4
0
 public void GetCursorPos(out int line, out int column)
 {
     PluginBase.GetCursorPos(out line, out column);
 }
Ejemplo n.º 5
0
 public void SelectionMoveToLineAndOffset(int startLine, int startColumn)
 {
     PluginBase.GoToPosition(startLine, startColumn);
 }