Example #1
0
 /// <summary>
 ///
 /// </summary>
 private void ResetCurrentLocation()
 {
     if ((PluginBase.MainForm as Form).InvokeRequired)
     {
         (PluginBase.MainForm as Form).BeginInvoke((MethodInvoker)ResetCurrentLocation);
         return;
     }
     if (CurrentLocation.getFile() != null)
     {
         ScintillaControl sci;
         String           localPath = GetLocalPath(CurrentLocation.getFile());
         if (localPath != null)
         {
             sci = ScintillaHelper.GetScintillaControl(localPath);
             if (sci != null)
             {
                 Int32 i = ScintillaHelper.GetScintillaControlIndex(sci);
                 if (i != -1)
                 {
                     Int32 line = CurrentLocation.getLine() - 1;
                     sci.MarkerDelete(line, ScintillaHelper.markerCurrentLine);
                 }
             }
         }
     }
 }
 /// <summary>
 ///
 /// </summary>
 private void GotoCurrentLocation(bool bSetMarker)
 {
     if ((PluginBase.MainForm as Form).InvokeRequired)
     {
         (PluginBase.MainForm as Form).BeginInvoke((MethodInvoker) delegate()
         {
             GotoCurrentLocation(bSetMarker);
         });
         return;
     }
     if (CurrentLocation != null && CurrentLocation.getFile() != null)
     {
         ScintillaControl sci;
         String           localPath = GetLocalPath(CurrentLocation.getFile());
         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.getLine() - 1;
                     sci.GotoLine(line);
                     if (bSetMarker)
                     {
                         sci.MarkerAdd(line, ScintillaHelper.markerCurrentLine);
                     }
                 }
             }
         }
     }
 }