本文整理汇总了C#中CSharpBinderFlags类的典型用法代码示例。如果您正苦于以下问题:C# CSharpBinderFlags类的具体用法?C# CSharpBinderFlags怎么用?C# CSharpBinderFlags使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CSharpBinderFlags类属于命名空间,在下文中一共展示了CSharpBinderFlags类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssignBinaryDynamicCSharpExpression
internal AssignBinaryDynamicCSharpExpression(Type context, CSharpBinderFlags binderFlags, CSharpExpressionType binaryType, DynamicCSharpArgument left, DynamicCSharpArgument right)
: base(context, binderFlags)
{
OperationNodeType = binaryType;
Left = left;
Right = right;
}
示例2: GetIndex
//////////////////////////////////////////////////////////////////////
/// <summary>
/// Initializes a new CSharp get index binder.
/// </summary>
/// <param name="flags">The flags with which to initialize the binder.</param>
/// <param name="context">The <see cref="System.Type"/> that indicates where this operation is used.</param>
/// <param name="argumentInfo">The sequence of <see cref="CSharpArgumentInfo"/> instances for the arguments to this operation.</param>
/// <returns>Returns a new CSharp get index binder.</returns>
public static CallSiteBinder GetIndex(
CSharpBinderFlags flags,
Type context,
IEnumerable<CSharpArgumentInfo> argumentInfo)
{
return new CSharpGetIndexBinder(context, argumentInfo);
}
示例3: CSharpSetMemberBinder
public CSharpSetMemberBinder (CSharpBinderFlags flags, string name, Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
: base (name, false)
{
this.flags = flags;
this.callingContext = callingContext;
this.argumentInfo = argumentInfo.ToReadOnly ();
}
示例4: CSharpInvokeBinder
public CSharpInvokeBinder (CSharpBinderFlags flags, Type callingContext, IEnumerable<CSharpArgumentInfo> argumentInfo)
: base (CSharpArgumentInfo.CreateCallInfo (argumentInfo, 1))
{
this.flags = flags;
this.callingContext = callingContext;
this.argumentInfo = argumentInfo.ToReadOnly ();
}
示例5: InvokeMemberDynamicCSharpExpression
internal InvokeMemberDynamicCSharpExpression(Type context, CSharpBinderFlags binderFlags, string name, ReadOnlyCollection<Type> typeArguments, ReadOnlyCollection<DynamicCSharpArgument> arguments)
: base(context, binderFlags)
{
Name = name;
TypeArguments = typeArguments;
Arguments = arguments;
}
示例6: ReduceDynamicIndex
private static Expression ReduceDynamicIndex(GetIndexDynamicCSharpExpression index, Func<Expression, Expression> functionalOp, CSharpBinderFlags flags, bool prefix)
{
var args = default(DynamicCSharpArgument[]);
var block = default(Expression[]);
var temps = default(ParameterExpression[]);
var i = CopyArguments(index.Object, index.Arguments, prefix, out args, out block, out temps);
index = index.Update(temps[0], new TrueReadOnlyCollection<DynamicCSharpArgument>(args));
if (prefix)
{
block[i++] = index.ReduceAssignment(functionalOp(index), flags);
}
else
{
var lastTemp = temps[i] = Expression.Parameter(index.Type, "__index");
block[i] = Expression.Assign(temps[i], index);
i++;
block[i++] = index.ReduceAssignment(functionalOp(lastTemp), flags);
block[i++] = lastTemp;
}
var res = Expression.Block(temps, block);
return res;
}
示例7: GetMemberDynamicCSharpExpression
internal GetMemberDynamicCSharpExpression(Type context, CSharpBinderFlags binderFlags, Expression @object, string name, ReadOnlyCollection<DynamicCSharpArgument> arguments)
: base(context, binderFlags)
{
Object = @object;
Name = name;
Arguments = arguments;
}
示例8: CSharpInvokeMemberBinder
public CSharpInvokeMemberBinder (CSharpBinderFlags flags, string name, Type callingContext, IEnumerable<Type> typeArguments, IEnumerable<CSharpArgumentInfo> argumentInfo)
: base (name, false, CSharpArgumentInfo.CreateCallInfo (argumentInfo, 1))
{
this.flags = flags;
this.callingContext = callingContext;
this.argumentInfo = argumentInfo.ToReadOnly ();
this.typeArguments = typeArguments.ToReadOnly ();
}
示例9: CSharpUnaryOperationBinder
public CSharpUnaryOperationBinder (ExpressionType operation, CSharpBinderFlags flags, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
: base (operation)
{
this.argumentInfo = argumentInfo.ToReadOnly ();
if (this.argumentInfo.Count != 1)
throw new ArgumentException ("Unary operation requires 1 argument");
this.flags = flags;
this.context = context;
}
示例10: BinaryOperation
// or is it part of roslyn not clr?
public static CallSiteBinder BinaryOperation(CSharpBinderFlags flags, ExpressionType operation, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
{
return (CallSiteBinder)(object)new __BinaryOperationBinder
{
flags = flags,
operation = operation,
context = context,
argumentInfo = argumentInfo
};
}
示例11: CSharpBinaryOperationBinder
public CSharpBinaryOperationBinder (ExpressionType operation, CSharpBinderFlags flags, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
: base (operation)
{
this.argumentInfo = new ReadOnlyCollectionBuilder<CSharpArgumentInfo> (argumentInfo);
if (this.argumentInfo.Count != 2)
throw new ArgumentException ("Binary operation requires 2 arguments");
this.flags = flags;
this.context = context;
}
示例12: UnaryOperation
public static CallSiteBinder UnaryOperation(CSharpBinderFlags flags, ExpressionType operation, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
{
// X:\jsc.svn\examples\javascript\Test\TestUnaryOperation\TestUnaryOperation\Application.cs
return (CallSiteBinder)(object)new __UnaryOperationBinder
{
flags = flags,
operation = operation,
context = context,
argumentInfo = argumentInfo
};
}
示例13: InvokeMember
// Z:\jsc.svn\core\ScriptCoreLib\Shared\BCLImplementation\Microsoft\CSharp\RuntimeBinder\Binder.cs
public static CallSiteBinder InvokeMember(
CSharpBinderFlags flags,
string name,
IEnumerable<Type> typeArguments,
Type context,
IEnumerable<CSharpArgumentInfo> argumentInfo
)
{
// https://sites.google.com/a/jsc-solutions.net/work/knowledge-base/15-dualvr/20160103/ndktype
return null;
}
示例14: GetIndex
// how does this
public static CallSiteBinder GetIndex(CSharpBinderFlags flags, Type context, IEnumerable<CSharpArgumentInfo> argumentInfo)
{
// X:\jsc.svn\examples\javascript\test\TestDynamicGetIndex\TestDynamicGetIndex\Application.cs
return (CallSiteBinder)(object)new __GetIndexBinder
{
flags = flags,
context = context,
argumentInfo = argumentInfo
};
}
示例15: Convert
//////////////////////////////////////////////////////////////////////
/// <summary>
/// Initializes a new CSharp convert binder.
/// </summary>
/// <param name="flags">The flags with which to initialize the binder.</param>
/// <param name="type">The type to convert to.</param>
/// <param name="context">The <see cref="System.Type"/> that indicates where this operation is used.</param>
/// <returns>Returns a new CSharp convert binder.</returns>
public static CallSiteBinder Convert(
CSharpBinderFlags flags,
Type type,
Type context)
{
CSharpConversionKind conversionKind =
((flags & CSharpBinderFlags.ConvertExplicit) != 0) ?
CSharpConversionKind.ExplicitConversion :
((flags & CSharpBinderFlags.ConvertArrayIndex) != 0) ?
CSharpConversionKind.ArrayCreationConversion :
CSharpConversionKind.ImplicitConversion;
bool isChecked = (flags & CSharpBinderFlags.CheckedContext) != 0;
return new CSharpConvertBinder(type, conversionKind, isChecked, context);
}