本文整理汇总了C#中ScintillaNet.ScintillaControl.GotoPos方法的典型用法代码示例。如果您正苦于以下问题:C# ScintillaControl.GotoPos方法的具体用法?C# ScintillaControl.GotoPos怎么用?C# ScintillaControl.GotoPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScintillaNet.ScintillaControl
的用法示例。
在下文中一共展示了ScintillaControl.GotoPos方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
}
示例2: GoToLineEnd
public static void GoToLineEnd(ScintillaControl sci, Boolean insertNewLine)
{
sci.GotoPos(sci.LineEndPosition(sci.LineFromPosition(sci.CurrentPos)));
if (insertNewLine) sci.NewLine();
}
示例3: SetCaretReadyToTrace
public static void SetCaretReadyToTrace(ScintillaControl sci, Boolean insertNewLine)
{
GoToLineEnd(sci, false);
if (NextNonWhiteCharIsOpenBrace(sci, sci.CurrentPos))
sci.GotoPos(sci.PositionAfter(NextCharPosition(sci, sci.CurrentPos, "{")));
if (insertNewLine) sci.NewLine();
}
示例4: GetText
public static String GetText(ScintillaControl sci, Int32 startPosition, Int32 endPosition)
{
Int32 curPos = sci.CurrentPos;
Int32 selStart = sci.SelectionStart;
Int32 selEnd = sci.SelectionEnd;
Int32 firstLine = sci.FirstVisibleLine;
sci.SetSel(startPosition, endPosition);
String text = sci.SelText;
sci.GotoPos(curPos);
sci.SetSel(selStart, selEnd);
Int32 actualFirstLine = sci.FirstVisibleLine;
if (actualFirstLine != firstLine)
{
sci.LineScroll(0, firstLine - actualFirstLine);
}
return text;
}
示例5: NextCharPosition
public static Int32 NextCharPosition(ScintillaControl sci, Int32 position, String c)
{
Int32 curPos = sci.CurrentPos;
sci.GotoPos(position);
char currentChar = (char)sci.CharAt(sci.CurrentPos);
if (currentChar.ToString().Equals(c)) sci.CharRight();
sci.SearchAnchor();
Int32 next = sci.SearchNext(0, c);
sci.GotoPos(curPos);
return next;
}
示例6: CompletionList_OnInsert
void CompletionList_OnInsert(ScintillaControl sender, int position, string text, char trigger, ICompletionListItem item)
{
if (trigger == '(' || trigger == '.') return;
if (!(item is MemberItem)) return; // Generate Event
// if (item is EventItem) return;
currentData = (DataEvent)currentNotifyEvent;
Hashtable table = currentData.Data as Hashtable;
if (table==null) return;
ASResult res = (table)["context"] as ASResult;
if (res == null) return;
MemberModel member = res.Member;
int posAdd = 0;
if (member != null)
{
if ((member.Flags & FlagType.Function) == 0) { return; }
int pos = sender.CurrentPos;
int insertPos = pos;
if (((member.Flags & FlagType.Constructor) > 0))
{
if (!thereIsNewWord(sender))
{
sender.GotoPos(pos);
return;
}
}
// sender.ReplaceSel
bool hasParameters = false;
char lastChar=' ';
posAdd = SearchNextNewLineWithoutChar(sender, position, text, ref lastChar);
if (lastChar == '(')
{
return;
}
// Search if is a parameter of a function
if (lastChar == ',' || lastChar == ')')
{
if (IsFunctionParameter(sender, position - 1))
{
return;
};
}
sender.BeginUndoAction();
if (posAdd > 0)
{
sender.InsertText(pos, "();");
posAdd = 1;
}
else
sender.InsertText(pos, "()");
pos++;
if (!(trigger == '[' || trigger == '"'))
{
if (member.Parameters != null)
{
if (member.Parameters.Count == 0)
{
pos += 1 + posAdd;
}
else
{
hasParameters = true;
}
}
else
{
pos += 1 + posAdd;
}
}
sender.GotoPos(pos);
if (hasParameters)
{
if (abbreviations != null && member.Parameters[0].Value == null && member.Parameters[0].Name != "...rest")
{
// string str = res.Member.ToString();
TextParameters tp = new TextParameters(res.Member);
if (member.Name.EndsWith("EventListener"))
{
if (text.EndsWith("Event"))
//.........这里部分代码省略.........
示例7: ProcessAbbrevation
private bool ProcessAbbrevation(ScintillaControl sci)
{
//if (_settings.abbrevationDictList == null)
//{
// System.Windows.Forms.MessageBox.Show("Insert abbreviations before!!");
// return false;
//}
int start =0;
int end = 0;
string left = GetWordFromPosition(sci, ref start, ref end);
if (left != null)
{
String ext = System.IO.Path.GetExtension(ASContext.Context.CurrentFile).ToLower(); ;
dictAbbreviations = null;
if (!settings.abbrevationDictList.TryGetValue(ext, out dictAbbreviations))
{
dictAbbreviations = settings.abbrevationDictList[".other"];
}
AbbrevationSnippet abbrevationSnippet;
if (dictAbbreviations.TryGetValue(left , out abbrevationSnippet))
{
sci.GotoPos(start);
sci.BeginUndoAction();
CreateWords cwNew;
// c'è una abbreviazione lo creo
if (currentCreateWords != null)
cw_MonitorOnWordsDeactive(currentCreateWords);
cwNew = CreateNewWords();
string elaborateText = cwNew.MakeTextFromSnippet(sci, abbrevationSnippet);
sci.SetSel(start, end);
sci.ReplaceSel(elaborateText);
if (abbrevationSnippet.Arguments == null)
{
cwNew.MonitorOnWordsActive -= new OnMonitorActiveEventHanlder(cw_MonitorOnWordsActive);
cwNew.MonitorOnWordsDeactive -= new OnMonitorActiveEventHanlder(cw_MonitorOnWordsDeactive);
sci.EndUndoAction();
return true;
}
DoBeforeMonitor();
// nessuna activazione quindi nessun monitor
if (!currentCreateWords.TryActivateMonitor())
{
cwNew.MonitorOnWordsActive -= new OnMonitorActiveEventHanlder(cw_MonitorOnWordsActive);
cwNew.MonitorOnWordsDeactive -= new OnMonitorActiveEventHanlder(cw_MonitorOnWordsDeactive);
}
else
{
currentCreateWords = cwNew;
}
sci.EndUndoAction();
return true;
}
}
//non ha trovato nessuna parola
if (isCursor)
{
isCursor = false;
ShowListAbbrevations();
return false;
}
if (MonitorWordsActive && currentSci.Focused)
currentCreateWords.MoveNextWord();
else
ShowListAbbrevations();
return false;
}
示例8: 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();
}