本文整理汇总了C#中Selector.FindType方法的典型用法代码示例。如果您正苦于以下问题:C# Selector.FindType方法的具体用法?C# Selector.FindType怎么用?C# Selector.FindType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Selector
的用法示例。
在下文中一共展示了Selector.FindType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Preprocess
private static Selector Preprocess(Selector sel, string contentType)
{
if (contentType == "SCSS")
return new CssParser().Parse(ScssDocument.GetScssSelectorName(sel.FindType<RuleSet>()) + "{color: red}",
false).RuleSets[0].Selectors[0];
return new CssParser().Parse(LessDocument.GetLessSelectorName(sel.FindType<RuleSet>()) + "{color: red}",
false).RuleSets[0].Selectors[0];
}
示例2: HandleSelector
private bool HandleSelector(Direction direction, Selector selector)
{
//new WriteBrowserXml().Parse();
RuleSet rule = selector.FindType<RuleSet>();
if (rule == null)
return false;
if (direction == Direction.Up)
{
rule = rule.PreviousSibling as RuleSet;
if (rule == null)
return false;
}
EditorExtensionsPackage.DTE.UndoContext.Open("Move CSS rule");
using (ITextEdit edit = _textView.TextBuffer.CreateEdit())
{
int position = SwapItemWithNextSibling(rule, edit);
if (position > -1)
{
if (direction == Direction.Down)
_textView.Caret.MoveTo(new SnapshotPoint(_textView.TextBuffer.CurrentSnapshot, position + 1));
else
_textView.Caret.MoveTo(new SnapshotPoint(_textView.TextBuffer.CurrentSnapshot, rule.Start + 1));
// TODO: Format both rules
EditorExtensionsPackage.DTE.ExecuteCommand("Edit.FormatSelection");
}
EditorExtensionsPackage.DTE.UndoContext.Close();
}
return true;
}