Пример #1
0
        void ResetCurrentLocation()
        {
            if ((PluginBase.MainForm as Form).InvokeRequired)
            {
                (PluginBase.MainForm as Form).BeginInvoke((MethodInvoker) delegate()
                {
                    ResetCurrentLocation();
                });
                return;
            }

            if (CurrentLocation.File != null)
            {
                ScintillaControl sci;
                String           localPath = GetLocalPath(CurrentLocation.File);

                if (localPath != null)
                {
                    sci = ScintillaHelper.GetScintillaControl(localPath);

                    if (sci != null)
                    {
                        Int32 i = ScintillaHelper.GetScintillaControlIndex(sci);

                        if (i != -1)
                        {
                            Int32 line = CurrentLocation.Line - 1;
                            sci.MarkerDelete(line, ScintillaHelper.markerCurrentLine);
                        }
                    }
                }
            }
        }
Пример #2
0
        void GotoCurrentLocation(bool bSetMarker)
        {
            if ((PluginBase.MainForm as Form).InvokeRequired)
            {
                (PluginBase.MainForm as Form).BeginInvoke((MethodInvoker) delegate()
                {
                    GotoCurrentLocation(bSetMarker);
                });
                return;
            }

            if (CurrentLocation != null && CurrentLocation.File != null)
            {
                ScintillaControl sci;
                String           localPath = GetLocalPath(CurrentLocation.File);

                if (localPath != null)
                {
                    sci = ScintillaHelper.GetScintillaControl(localPath);

                    if (sci == null)
                    {
                        PluginBase.MainForm.OpenEditableDocument(localPath);
                        sci = ScintillaHelper.GetScintillaControl(localPath);
                    }

                    if (sci != null)
                    {
                        Int32 i = ScintillaHelper.GetScintillaControlIndex(sci);

                        if (i != -1)
                        {
                            PluginBase.MainForm.Documents[i].Activate();
                            Int32 line = CurrentLocation.Line - 1;
                            sci.GotoLine(line);

                            if (bSetMarker)
                            {
                                sci.MarkerAdd(line, ScintillaHelper.markerCurrentLine);
                            }
                        }
                    }
                }
            }
        }