/// <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> /// /// </summary> static private void CLDoubleClick(Object sender, System.EventArgs e) { ITabbedDocument doc = PluginBase.MainForm.CurrentDocument; if (!doc.IsEditable) { Hide(); return; } ScintillaControl sci = doc.SciControl; sci.Focus(); ReplaceText(sci, '\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(); } }