本文整理汇总了C#中EnvDTE.GetText方法的典型用法代码示例。如果您正苦于以下问题:C# EnvDTE.GetText方法的具体用法?C# EnvDTE.GetText怎么用?C# EnvDTE.GetText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EnvDTE
的用法示例。
在下文中一共展示了EnvDTE.GetText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SkipWhitespace
/**
* Helper function returns -1 if the line is empty else returns the
* amount of whitespace pt is indented by
*/
private static int SkipWhitespace(
EnvDTE.EditPoint pt)
{
int start = pt.DisplayColumn;
while (!pt.AtEndOfLine &&
((pt.GetText(1) == " ") ||
(pt.GetText(1) == "\t")))
{
pt.CharRight(1);
}
if (pt.AtEndOfLine)
{
return -1;
}
else
{
return pt.DisplayColumn-start;
}
}
示例2: GoToEndOfPreviousWord
private static void GoToEndOfPreviousWord(
EnvDTE.EditPoint pt)
{
pt.CharLeft(1);
while ((pt.GetText(1) != " ") &&
(pt.GetText(1) != "\t"))
{
pt.CharLeft(1);
}
while ((pt.GetText(1) == " ") ||
(pt.GetText(1) == "\t"))
{
pt.CharLeft(1);
}
pt.CharRight(1);
}
示例3: GetTextOnLine
private static string GetTextOnLine(EnvDTE.EditPoint pt, int length)
{
if (length > (pt.LineLength - (pt.LineCharOffset-1)))
{
length = pt.LineLength - (pt.LineCharOffset-1);
}
string st = pt.GetText(length);
return st;
}
示例4: GoToEndOfNextWord
// pre: must be a word before the end of the line moves to the end of
// the word
private static void GoToEndOfNextWord(
EnvDTE.EditPoint pt)
{
while ((pt.GetText(1) == " ") ||
(pt.GetText(1) == "\t"))
{
pt.CharRight(1);
}
while ((!pt.AtEndOfLine) &&
(pt.GetText(1) != " ") &&
(pt.GetText(1) != "\t"))
{
pt.CharRight(1);
}
}
示例5: GetRestOfLine
private static string GetRestOfLine(EnvDTE.EditPoint pt)
{
return pt.GetText(pt.LineLength - (pt.LineCharOffset-1));
}