/// <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); } }
/// <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(); } }
/// <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(); }