本文整理汇总了C#中CsElement.WalkElement方法的典型用法代码示例。如果您正苦于以下问题:C# CsElement.WalkElement方法的具体用法?C# CsElement.WalkElement怎么用?C# CsElement.WalkElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CsElement
的用法示例。
在下文中一共展示了CsElement.WalkElement方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetParameters
/// <summary>
/// Gets a list of parameters for an element.
/// </summary>
public static List<ParameterItem> GetParameters(CsElement element)
{
IEnumerable<Parameter> ownParameters = new List<Parameter>();
switch (element.ElementType)
{
case ElementType.Constructor:
ownParameters = ((Constructor)element).Parameters;
break;
case ElementType.Delegate:
ownParameters = ((Delegate)element).Parameters;
break;
case ElementType.Indexer:
ownParameters = ((Indexer)element).Parameters;
break;
case ElementType.Method:
ownParameters = ((Method)element).Parameters;
break;
}
List<ParameterItem> result = ConvertParameters(ownParameters);
element.WalkElement(null, null, GetParametersExpressionVisitor, result);
return result;
}
示例2: GetLabels
/// <summary>
/// Gets labels.
/// </summary>
public static List<LabelItem> GetLabels(CsElement element)
{
List<LabelItem> result = new List<LabelItem>();
element.WalkElement(null, GetLabelsStatementVisitor, result);
return result;
}
示例3: GetLocalDeclarations
/// <summary>
/// Gets local declarations.
/// </summary>
public static List<LocalDeclarationItem> GetLocalDeclarations(CsElement element)
{
List<LocalDeclarationItem> result = new List<LocalDeclarationItem>();
element.WalkElement(null, GetLocalDeclarationsStatementVisitor, result);
return result;
}
示例4: CheckNoValueFirstComparison
/// <summary>
/// Checks that comparisons are not in reverse (value first) order.
/// </summary>
/// <param name="element">
/// The element to check.
/// </param>
/// <param name="checkGeneratedCode">
/// Indicates whether to check the order of elements
/// within generated blocks of code.
/// </param>
private void CheckNoValueFirstComparison(CsElement element, bool checkGeneratedCode)
{
Param.AssertNotNull(element, "element");
if (!element.Generated || checkGeneratedCode)
{
element.WalkElement(null, null, this.ExpressionCallback);
}
}