當前位置: 首頁>>代碼示例>>C#>>正文


C# ScintillaControl.EnsureVisible方法代碼示例

本文整理匯總了C#中ScintillaNet.ScintillaControl.EnsureVisible方法的典型用法代碼示例。如果您正苦於以下問題:C# ScintillaControl.EnsureVisible方法的具體用法?C# ScintillaControl.EnsureVisible怎麽用?C# ScintillaControl.EnsureVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ScintillaNet.ScintillaControl的用法示例。


在下文中一共展示了ScintillaControl.EnsureVisible方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SelectMatch

 /// <summary>
 /// Selects a search match
 /// </summary>
 public static void SelectMatch(ScintillaControl sci, SearchMatch match)
 {
     Int32 start = sci.MBSafePosition(match.Index); // wchar to byte position
     Int32 end = start + sci.MBSafeTextLength(match.Value); // wchar to byte text length
     Int32 line = sci.LineFromPosition(start);
     sci.EnsureVisible(line);
     sci.SetSel(start, end);
 }
開發者ID:ImaginationSydney,項目名稱:flashdevelop,代碼行數:11,代碼來源:FRDialogGenerics.cs

示例2: BookmarkMatches

 /// <summary>
 /// Bookmarks a search match
 /// </summary>
 public static void BookmarkMatches(ScintillaControl sci, List<SearchMatch> matches)
 {
     for (Int32 i = 0; i < matches.Count; i++)
     {
         Int32 line = matches[i].Line - 1;
         sci.EnsureVisible(line);
         sci.MarkerAdd(line, 0);
     }
 }
開發者ID:ImaginationSydney,項目名稱:flashdevelop,代碼行數:12,代碼來源:FRDialogGenerics.cs

示例3: ReplaceMatches

 /// <summary>
 /// Replaces only the matches in the current sci control
 /// </summary>
 public static void ReplaceMatches(IList<SearchMatch> matches, ScintillaControl sci, String replacement, String src)
 {
     if (sci == null || matches == null || matches.Count == 0) return;
     sci.BeginUndoAction();
     try
     {
         for (Int32 i = 0; i < matches.Count; i++)
         {
             SelectMatch(sci, matches[i]);
             FRSearch.PadIndexes((List<SearchMatch>)matches, i, matches[i].Value, replacement);
             sci.EnsureVisible(sci.LineFromPosition(sci.MBSafePosition(matches[i].Index)));
             sci.ReplaceSel(replacement);
         }
     }
     finally
     {
         sci.EndUndoAction();
     }
 }
開發者ID:thecocce,項目名稱:flashdevelop,代碼行數:22,代碼來源:RefactoringHelper.cs

示例4: ApplyStateObject

 /// <summary>
 /// Applies the state object to a scintilla control
 /// </summary>
 private static void ApplyStateObject(ScintillaControl sci, StateObject so, Boolean restorePosition)
 {
     if (so.LineCount != sci.LineCount) return;
     sci.Refresh(); // Update the scintilla control state
     for (Int32 i = 0; i < so.FoldedLines.Count; i++)
     {
         Int32 foldedLine = so.FoldedLines[i];
         sci.ToggleFold(foldedLine);
     }
     if (so.BookmarkedLines != null)
     {
         for (Int32 i = 0; i < so.BookmarkedLines.Count; i++)
         {
             Int32 bookmarkedLine = so.BookmarkedLines[i];
             sci.MarkerAdd(bookmarkedLine, 0);
         }
         sci.Refresh(); // Update again
     }
     if (restorePosition)
     {
         sci.FirstVisibleLine = so.LineScroll;
         Int32 line = sci.LineFromPosition(so.Position);
         sci.SetSel(so.Position, so.Position);
         sci.EnsureVisible(line);
     }
 }
開發者ID:xeronith,項目名稱:flashdevelop,代碼行數:29,代碼來源:FileStateManager.cs

示例5: MoveToPosition

 /// <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();
     }
 }
開發者ID:JoeRobich,項目名稱:flashdevelop,代碼行數:22,代碼來源:PluginUI.cs

示例6: MBSafeSetSelAndFocus

 /// <summary>
 /// Goes to the match and ensures that correct fold is opened
 /// </summary>
 private void MBSafeSetSelAndFocus(ScintillaControl sci, Int32 line, Int32 startPosition, Int32 endPosition)
 {
     sci.MBSafeSetSel(startPosition, endPosition);
     sci.EnsureVisible(line);
 }
開發者ID:zpLin,項目名稱:flashdevelop,代碼行數:8,代碼來源:PluginUI.cs

示例7: MoveToPosition

 /// <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();
 }
開發者ID:nomilogic,項目名稱:fdplugins,代碼行數:13,代碼來源:PluginUI.cs


注:本文中的ScintillaNet.ScintillaControl.EnsureVisible方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。