/// <summary>
 /// Makes the read only file writable
 /// </summary>
 public static void MakeFileWritable(ScintillaControl sci)
 {
     try
     {
         String file = sci.FileName;
         File.SetAttributes(file, FileAttributes.Normal);
         sci.IsReadOnly = false;
         sci.Focus();
     }
     catch (Exception ex)
     {
         ErrorManager.ShowError(ex);
     }
 }
Example #2
0
 /// <summary>
 /// Move the document position
 /// </summary>
 private void MoveToPosition(ScintillaControl sci, Int32 position)
 {
     try
     {
         position = sci.MBSafePosition(position); // scintilla indexes are in 8bits
         Int32 line = sci.LineFromPosition(position);
         sci.EnsureVisible(line);
         sci.GotoPos(position);
         sci.SetSel(position, sci.LineEndPosition(line));
         sci.Focus();
     }
     catch 
     {
         String message = TextHelper.GetString("Info.InvalidItem");
         ErrorManager.ShowInfo(message);
         this.RemoveInvalidItems();
         this.RefreshProject();
     }
 }
Example #3
0
 /// <summary>
 /// Move the document position
 /// </summary>
 /// <param name="sci"></param>
 /// <param name="position"></param>
 private void MoveToPosition( ScintillaControl sci, int position )
 {
     int line = sci.LineFromPosition(position);
     sci.EnsureVisible( line );
     sci.GotoPos(position);
     sci.SetSel(position, sci.LineEndPosition(line));
     sci.Focus();
 }