本文整理汇总了C#中CodeExpression.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# CodeExpression.GetType方法的具体用法?C# CodeExpression.GetType怎么用?C# CodeExpression.GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CodeExpression
的用法示例。
在下文中一共展示了CodeExpression.GetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateExpression
protected void GenerateExpression(CodeExpression e)
{
if (e == null)
throw new ArgumentNullException("e");
try
{
e.Accept(visitor);
}
catch (NotImplementedException)
{
throw new ArgumentException("Element type " + e.GetType() + " is not supported.", "e");
}
}
示例2: GenerateExpression
//.........这里部分代码省略.........
else if (e is CodeCastExpression)
{
GenerateCastExpression((CodeCastExpression)e);
}
else if (e is CodeDelegateCreateExpression)
{
GenerateDelegateCreateExpression((CodeDelegateCreateExpression)e);
}
else if (e is CodeFieldReferenceExpression)
{
GenerateFieldReferenceExpression((CodeFieldReferenceExpression)e);
}
else if (e is CodeArgumentReferenceExpression)
{
GenerateArgumentReferenceExpression((CodeArgumentReferenceExpression)e);
}
else if (e is CodeVariableReferenceExpression)
{
GenerateVariableReferenceExpression((CodeVariableReferenceExpression)e);
}
else if (e is CodeIndexerExpression)
{
GenerateIndexerExpression((CodeIndexerExpression)e);
}
else if (e is CodeArrayIndexerExpression)
{
GenerateArrayIndexerExpression((CodeArrayIndexerExpression)e);
}
else if (e is CodeSnippetExpression)
{
GenerateSnippetExpression((CodeSnippetExpression)e);
}
else if (e is CodeMethodInvokeExpression)
{
GenerateMethodInvokeExpression((CodeMethodInvokeExpression)e);
}
else if (e is CodeMethodReferenceExpression)
{
GenerateMethodReferenceExpression((CodeMethodReferenceExpression)e);
}
else if (e is CodeEventReferenceExpression)
{
GenerateEventReferenceExpression((CodeEventReferenceExpression)e);
}
else if (e is CodeDelegateInvokeExpression)
{
GenerateDelegateInvokeExpression((CodeDelegateInvokeExpression)e);
}
else if (e is CodeObjectCreateExpression)
{
GenerateObjectCreateExpression((CodeObjectCreateExpression)e);
}
else if (e is CodeParameterDeclarationExpression)
{
GenerateParameterDeclarationExpression((CodeParameterDeclarationExpression)e);
}
else if (e is CodeDirectionExpression)
{
GenerateDirectionExpression((CodeDirectionExpression)e);
}
else if (e is CodePrimitiveExpression)
{
GeneratePrimitiveExpression((CodePrimitiveExpression)e);
}
else if (e is CodePropertyReferenceExpression)
{
GeneratePropertyReferenceExpression((CodePropertyReferenceExpression)e);
}
else if (e is CodePropertySetValueReferenceExpression)
{
GeneratePropertySetValueReferenceExpression((CodePropertySetValueReferenceExpression)e);
}
else if (e is CodeThisReferenceExpression)
{
GenerateThisReferenceExpression((CodeThisReferenceExpression)e);
}
else if (e is CodeTypeReferenceExpression)
{
GenerateTypeReferenceExpression((CodeTypeReferenceExpression)e);
}
else if (e is CodeTypeOfExpression)
{
GenerateTypeOfExpression((CodeTypeOfExpression)e);
}
else if (e is CodeDefaultValueExpression)
{
GenerateDefaultValueExpression((CodeDefaultValueExpression)e);
}
else
{
if (e == null)
{
throw new ArgumentNullException(nameof(e));
}
else
{
throw new ArgumentException(SR.Format(SR.InvalidElementType, e.GetType().FullName), nameof(e));
}
}
}
示例3: GenerateExpression
private void GenerateExpression(CodeExpression expression)
{
if (expression is CodeArrayCreateExpression)
{
GenerateArrayCreateExpression((CodeArrayCreateExpression)expression);
}
else if (expression is CodeBaseReferenceExpression)
{
GenerateBaseReferenceExpression((CodeBaseReferenceExpression)expression);
}
else if (expression is CodeBinaryOperatorExpression)
{
GenerateBinaryOperatorExpression((CodeBinaryOperatorExpression)expression);
}
else if (expression is CodeCastExpression)
{
GenerateCastExpression((CodeCastExpression)expression);
}
else if (expression is CodeFieldReferenceExpression)
{
GenerateFieldReferenceExpression((CodeFieldReferenceExpression)expression);
}
else if (expression is CodeArgumentReferenceExpression)
{
GenerateArgumentReferenceExpression((CodeArgumentReferenceExpression)expression);
}
else if (expression is CodeVariableReferenceExpression)
{
GenerateVariableReferenceExpression((CodeVariableReferenceExpression)expression);
}
else if (expression is CodeArrayIndexerExpression)
{
GenerateArrayIndexerExpression((CodeArrayIndexerExpression)expression);
}
else if (expression is CodeSnippetExpression)
{
GenerateSnippetExpression((CodeSnippetExpression)expression);
}
else if (expression is CodeMethodInvokeExpression)
{
GenerateMethodInvokeExpression((CodeMethodInvokeExpression)expression);
}
else if (expression is CodeMethodReferenceExpression)
{
GenerateMethodReferenceExpression((CodeMethodReferenceExpression)expression);
}
else if (expression is CodeObjectCreateExpression)
{
GenerateObjectCreateExpression((CodeObjectCreateExpression)expression);
}
else if (expression is CodeParameterDeclarationExpression)
{
GenerateParameterDeclarationExpression((CodeParameterDeclarationExpression)expression);
}
else if (expression is CodePrimitiveExpression)
{
GeneratePrimitiveExpression((CodePrimitiveExpression)expression);
}
else if (expression is CodePropertyReferenceExpression)
{
GeneratePropertyReferenceExpression((CodePropertyReferenceExpression)expression);
}
else if (expression is CodePropertySetValueReferenceExpression)
{
GeneratePropertySetValueReferenceExpression((CodePropertySetValueReferenceExpression)expression);
}
else if (expression is CodeThisReferenceExpression)
{
GenerateThisReferenceExpression((CodeThisReferenceExpression)expression);
}
else if (expression is CodeTypeReferenceExpression)
{
GenerateTypeReferenceExpression((CodeTypeReferenceExpression)expression);
}
else if (expression is CodeTypeOfExpression)
{
GenerateTypeOfExpression((CodeTypeOfExpression)expression);
}
else if (expression is CodeDefaultValueExpression)
{
GenerateDefaultValueExpression((CodeDefaultValueExpression)expression);
}
else
{
if (expression == null)
{
throw new ArgumentNullException("e");
}
else
{
throw new ArgumentException("e is of an invalid type: " + expression.GetType().FullName, "e");
}
}
}