本文整理汇总了C#中ExpressionList类的典型用法代码示例。如果您正苦于以下问题:C# ExpressionList类的具体用法?C# ExpressionList怎么用?C# ExpressionList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExpressionList类属于命名空间,在下文中一共展示了ExpressionList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitExpressionList
public virtual ExpressionList VisitExpressionList(ExpressionList list)
{
if (list == null) return null;
for (int i = 0, n = list.Count; i < n; i++)
list[i] = (Expression)this.Visit(list[i]);
return list;
}
示例2: VisitCall
/// <summary>
/// Visits the call.
/// </summary>
/// <param name="destination">The destination.</param>
/// <param name="receiver">The receiver.</param>
/// <param name="callee">The callee.</param>
/// <param name="arguments">The arguments.</param>
/// <param name="isVirtualCall">if set to <c>true</c> [is virtual call].</param>
/// <param name="programContext">The program context.</param>
/// <param name="stateBeforeInstruction">The state before instruction.</param>
/// <param name="stateAfterInstruction">The state after instruction.</param>
public override void VisitCall(
Variable destination,
Variable receiver,
Method callee,
ExpressionList arguments,
bool isVirtualCall,
Microsoft.Fugue.IProgramContext programContext,
Microsoft.Fugue.IExecutionState stateBeforeInstruction,
Microsoft.Fugue.IExecutionState stateAfterInstruction)
{
if ((callee.DeclaringType.GetRuntimeType() == typeof(X509ServiceCertificateAuthentication) ||
callee.DeclaringType.GetRuntimeType() == typeof(X509ClientCertificateAuthentication)) &&
(callee.Name.Name.Equals("set_CertificateValidationMode", StringComparison.InvariantCultureIgnoreCase)))
{
IAbstractValue value = stateBeforeInstruction.Lookup((Variable)arguments[0]);
IIntValue intValue = value.IntValue(stateBeforeInstruction);
if (intValue != null)
{
X509CertificateValidationMode mode = (X509CertificateValidationMode)intValue.Value;
if (mode != X509CertificateValidationMode.ChainTrust)
{
Resolution resolution = base.GetResolution(mode.ToString(),
X509CertificateValidationMode.ChainTrust.ToString());
Problem problem = new Problem(resolution, programContext);
base.Problems.Add(problem);
}
}
}
base.VisitCall(destination, receiver, callee, arguments, isVirtualCall, programContext, stateBeforeInstruction, stateAfterInstruction);
}
示例3: LiteralElement
public LiteralElement()
: base((NodeType)SpecSharpNodeType.None){
this.AttributeNames = new IdentifierList();
this.AttributeValues = new ExpressionList();
this.Contents = new ExpressionList();
this.ContentsType = new Int32List();
}
示例4: InterProcMapping
InterProcMapping(PTGraph caller, PTGraph callee, Variable thisRef, ExpressionList arguments)
{
this.calleePTG = callee;
this.callerPTG = caller;
this.callerThisRef = thisRef;
this.arguments = arguments;
}
示例5: AddTest
public void AddTest()
{
var list = new ExpressionList<ConstantTypes.Integer>();
var one = new ConstantTypes.Integer(1);
list.Add(one);
Assert.IsTrue(list.Contains(one));
}
示例6: Clone
private static ExpressionList Clone(ExpressionList expression)
{
var parameters = new Expression[expression.Count];
for (int i = 0; i < expression.Count; ++i)
parameters[i] = Clone(expression[i]);
return new ExpressionList(parameters);
}
示例7: GroupByClause
public GroupByClause(ExpressionList exprList)
{
foreach (Expression e in exprList) {
e.Parent = this;
_exprs.Add(e);
}
this.ExpressionType = ExpressionType.QL_SELECT_GROUP_BY;
}
示例8: SearchedCase
public SearchedCase(params KeyValuePair<Predicate, Expression>[] cases)
{
SearchCases = new ExpressionList<SearchedCaseExpression>();
foreach (var kvp in cases)
{
SearchCases.Add(new SearchedCaseExpression(kvp.Key, kvp.Value));
}
}
示例9: WhereClause
public WhereClause(ExpressionList exprList)
{
foreach (Expression e in exprList) {
e.Parent = this;
_exprs.Add(e);
}
this.ExpressionType = ExpressionType.QL_SELECT_WHERE_CLAUSE;
}
示例10: ClearTest
public void ClearTest()
{
var list = new ExpressionList<ConstantTypes.Integer>();
var one = new ConstantTypes.Integer(1);
list.Add(one);
Assert.IsTrue(list.Count == 1);
list.Clear();
Assert.IsTrue(list.Count == 0);
}
示例11: VisitRefTypeExpression
public override Expression VisitRefTypeExpression(RefTypeExpression reftypexp) {
if (reftypexp == null) return null;
Expression result = base.VisitRefTypeExpression (reftypexp);
if (result != reftypexp) return result;
UnaryExpression refanytype = new UnaryExpression(reftypexp.Operand, NodeType.Refanytype, SystemTypes.RuntimeTypeHandle, reftypexp.SourceContext);
ExpressionList arguments = new ExpressionList(1);
arguments.Add(refanytype);
MemberBinding mb = new MemberBinding(null, Runtime.GetTypeFromHandle);
return new MethodCall(mb, arguments, NodeType.Call, SystemTypes.Type);
}
示例12: ParenthesizedExpression
/// <summary>
/// Initializes a new instance of the <see cref="ParenthesizedExpression"/> class.
/// </summary>
/// <param name="content">The content.</param>
public ParenthesizedExpression(params Expression[] content)
{
if (content != null)
{
if (content.Length == 1)
Content = content[0];
else
Content = new ExpressionList(content);
}
}
示例13: VisitExpressionList
public override ExpressionList VisitExpressionList(ExpressionList expressions)
{
if (expressions == null) return null;
for(int i = expressions.Count-1; i >= 0; i--)
{
Expression elem = this.VisitExpression(expressions[i]);
System.Diagnostics.Debug.Assert(elem != null, "VisitExpression must return non null if passed non null");
expressions[i] = elem;
}
return expressions;
}
示例14: AbbreviationDuplicator
public AbbreviationDuplicator(Method sourceMethod, Method targetMethod, ContractNodes contractNodes,
Method abbreviation, Expression targetObject, ExpressionList actuals)
: base(targetMethod.DeclaringType.DeclaringModule, sourceMethod, targetMethod, contractNodes, false)
{
this.targetObject = targetObject;
this.abbreviation = abbreviation;
this.actuals = actuals;
this.localsInActuals = new TrivialHashtable();
PopulateLocalsInActuals();
}
示例15: CopyToTest
public void CopyToTest()
{
ExpressionList<ConstantTypes.Integer> list = new ExpressionList<ConstantTypes.Integer>();
var zero = new ConstantTypes.Integer(0);
var one = new ConstantTypes.Integer(1);
list.Add(zero);
list.Add(one);
ConstantTypes.Integer[] array = new ConstantTypes.Integer[2];
list.CopyTo(array, 0);
Assert.IsTrue(array.Length == 2);
Assert.IsTrue(array[0] == zero);
Assert.IsTrue(array[1] == one);
}