internal void OnLayoutChanged(object sender, TextViewLayoutChangedEventArgs e) // #eiichi OnLayoutChanged { // #hang_no 3 try { if (!Enabled) { return; } m_errorTags.Clear(); int dline = e.NewSnapshot.LineCount - e.OldSnapshot.LineCount; if (dline != 0) { foreach (ITextViewLine line in e.NewOrReformattedLines) { int editLineNumber = line.Snapshot.GetLineFromPosition(line.Start.Position).LineNumber; MyBookmarkManager.GetInstance().ChangeLine(editLineNumber + 1, dline); return; } /* foreach (ITextViewLine line in e.TranslatedLines) * { * int lineNumber = line.Snapshot.GetLineFromPosition(line.Start.Position).LineNumber; * m_editedLines[lineNumber] = line; * } */ } RequestRedrawView(); foreach (ITextViewLine line in e.NewOrReformattedLines) { int lineNumber = line.Snapshot.GetLineFromPosition(line.Start.Position).LineNumber; m_editedLines[lineNumber] = line; // #Image _editedLines[lineNumber] = line } ResetTimer(); // Sometimes, on loading a file in an editor view, the line transform gets triggered before the image adornments // have been added, so the lines don't resize to the image height. So here's a workaround: // Changing the zoom level triggers the required update. // Need to do it twice - once to trigger the event, and again to change it back to the user's expected level. if (!m_initialised1) { m_view.ZoomLevel++; m_initialised1 = true; } if (!m_initialised2) { m_view.ZoomLevel--; m_initialised2 = true; } } catch (Exception ex) { ExceptionHandler.Notify(ex, true); } }
private void OnBookmarkOptCommand(object sender, EventArgs e) { MyBookmarkManager.GetInstance().DelBookmark(); // Toggle the checked state of this command /* MenuCommand thisCommand = sender as MenuCommand; * if (thisCommand != null) * { * thisCommand.Checked = !thisCommand.Checked; * } */ }