本文整理汇总了C#中Mono.Debugging.Evaluation.EvaluationContext类的典型用法代码示例。如果您正苦于以下问题:C# EvaluationContext类的具体用法?C# EvaluationContext怎么用?C# EvaluationContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EvaluationContext类属于Mono.Debugging.Evaluation命名空间,在下文中一共展示了EvaluationContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FieldReference
public FieldReference (EvaluationContext ctx, TargetStructObject thisobj, TargetType type, TargetFieldInfo field): base (ctx)
{
this.type = type;
this.field = field;
if (!field.IsStatic)
this.thisobj = thisobj;
}
示例2: PropertyValueReference
public PropertyValueReference (EvaluationContext ctx, PropertyInfoMirror property, object obj, TypeMirror declaringType, Value[] indexerArgs): base (ctx)
{
this.property = property;
this.obj = obj;
this.declaringType = declaringType;
this.indexerArgs = indexerArgs;
flags = ObjectValueFlags.Property;
if (property.GetSetMethod (true) == null)
flags |= ObjectValueFlags.ReadOnly;
MethodMirror getter = property.GetGetMethod (true);
if (getter.IsStatic)
flags |= ObjectValueFlags.Global;
if (getter.IsPublic)
flags |= ObjectValueFlags.Public;
else if (getter.IsPrivate)
flags |= ObjectValueFlags.Private;
else if (getter.IsFamily)
flags |= ObjectValueFlags.Protected;
else if (getter.IsFamilyAndAssembly)
flags |= ObjectValueFlags.Internal;
else if (getter.IsFamilyOrAssembly)
flags |= ObjectValueFlags.InternalProtected;
if (property.DeclaringType.IsValueType)
flags |= ObjectValueFlags.ReadOnly; // Setting property values on structs is not supported by sdb
}
示例3: VariableReference
public VariableReference (EvaluationContext ctx, CorValRef var, string name, DC.ObjectValueFlags flags)
: base (ctx)
{
this.flags = flags;
this.var = var;
this.name = name;
}
示例4: Resolve
static string Resolve (this ComposedType type, EvaluationContext ctx, List<object> args)
{
string name;
if (type.HasNullableSpecifier) {
args.Insert (0, type.BaseType.Resolve (ctx));
name = "System.Nullable`1";
} else {
name = type.BaseType.Resolve (ctx, args);
}
if (type.PointerRank > 0)
name += new string ('*', type.PointerRank);
if (type.ArraySpecifiers.Count > 0) {
foreach (var spec in type.ArraySpecifiers) {
if (spec.Dimensions > 1)
name += "[" + new string (',', spec.Dimensions - 1) + "]";
else
name += "[]";
}
}
return name;
}
示例5: TypeValueReference
public TypeValueReference (EvaluationContext ctx, object type)
: base (ctx)
{
this.type = type;
fullName = ctx.Adapter.GetDisplayTypeName (ctx, type);
name = GetTypeName (fullName);
}
示例6: BaseTypeViewSource
public BaseTypeViewSource (EvaluationContext ctx, IObjectSource objectSource, object type, object obj)
{
this.ctx = ctx;
this.type = type;
this.obj = obj;
this.objectSource = objectSource;
}
示例7: VariableReference
public VariableReference (EvaluationContext ctx, TargetVariable var, DC.ObjectValueFlags flags): base (ctx)
{
this.flags = flags;
this.var = var;
if (!var.CanWrite)
flags |= DC.ObjectValueFlags.ReadOnly;
}
示例8: CreateNode
static ObjectValue CreateNode (EvaluationContext ctx, IObjectSource objectSource, object type, object obj, BindingFlags bindingFlags, string label)
{
FilteredMembersSource src = new FilteredMembersSource (ctx, objectSource, type, obj, bindingFlags);
src.Connect ();
ObjectValue val = ObjectValue.CreateObject (src, new ObjectPath (label), "", "", ObjectValueFlags.Group|ObjectValueFlags.ReadOnly|ObjectValueFlags.NoRefresh, null);
val.ChildSelector = "";
return val;
}
示例9: FilteredMembersSource
public FilteredMembersSource (EvaluationContext ctx, IObjectSource objectSource, object type, object obj, BindingFlags bindingFlags)
{
this.ctx = ctx;
this.obj = obj;
this.type = type;
this.bindingFlags = bindingFlags;
this.objectSource = objectSource;
}
示例10: TargetObjectToString
public string TargetObjectToString (EvaluationContext ctx, object obj)
{
object res = ctx.Adapter.TargetObjectToObject (ctx, obj);
if (res == null)
return null;
else
return res.ToString ();
}
示例11: CreateObjectLiteral
public static LiteralValueReference CreateObjectLiteral (EvaluationContext ctx, string name, object value)
{
LiteralValueReference val = new LiteralValueReference (ctx);
val.name = name;
val.objValue = value;
val.objLiteral = true;
return val;
}
示例12: CreateRawView
public static ObjectValue CreateRawView (EvaluationContext ctx, IObjectSource objectSource, object obj)
{
RawViewSource src = new RawViewSource (ctx, objectSource, obj);
src.Connect ();
ObjectValue val = ObjectValue.CreateObject (src, new ObjectPath ("Raw View"), "", "", ObjectValueFlags.Group|ObjectValueFlags.ReadOnly|ObjectValueFlags.NoRefresh, null);
val.ChildSelector = "";
return val;
}
示例13: ToExpression
public virtual EvaluationResult ToExpression (EvaluationContext ctx, object obj)
{
if (obj == null)
return new EvaluationResult ("null");
else if (obj is IntPtr) {
IntPtr p = (IntPtr) obj;
return new EvaluationResult ("0x" + p.ToInt64 ().ToString ("x"));
} else if (obj is char) {
char c = (char) obj;
string str;
if (c == '\'')
str = @"'\''";
else if (c == '"')
str = "'\"'";
else
str = EscapeString ("'" + c + "'");
return new EvaluationResult (str, ((int) c) + " " + str);
}
else if (obj is string) {
string val = "\"" + EscapeString ((string) obj) + "\"";
string display = val;
if (val.Length > EllipsizeLength + 2)
display = "\"" + EscapeString ((string) obj, EllipsizeLength) + "\"";
return new EvaluationResult (val, display);
} else if (obj is bool)
return new EvaluationResult (((bool)obj) ? "true" : "false");
else if (obj is decimal)
return new EvaluationResult (((decimal)obj).ToString (System.Globalization.CultureInfo.InvariantCulture));
else if (obj is EvaluationResult)
return (EvaluationResult) obj;
if (ctx.Options.IntegerDisplayFormat == IntegerDisplayFormat.Hexadecimal) {
string fval = null;
if (obj is sbyte)
fval = ((sbyte)obj).ToString ("x2");
else if (obj is int)
fval = ((int)obj).ToString ("x4");
else if (obj is short)
fval = ((short)obj).ToString ("x8");
else if (obj is long)
fval = ((long)obj).ToString ("x16");
else if (obj is byte)
fval = ((byte)obj).ToString ("x2");
else if (obj is uint)
fval = ((uint)obj).ToString ("x4");
else if (obj is ushort)
fval = ((ushort)obj).ToString ("x8");
else if (obj is ulong)
fval = ((ulong)obj).ToString ("x16");
if (fval != null)
return new EvaluationResult ("0x" + fval);
}
return new EvaluationResult (obj.ToString ());
}
示例14: PropertyValueReference
public PropertyValueReference (EvaluationContext ctx, PropertyInfoMirror property, object obj, TypeMirror declaringType, MethodMirror getter, Value[] indexerArgs): base (ctx)
{
this.property = property;
this.obj = obj;
this.declaringType = declaringType;
this.indexerArgs = indexerArgs;
flags = GetFlags (property, getter);
}
示例15: CreateObjectValue
public ObjectValue CreateObjectValue (EvaluationContext ctx, IObjectValueSource source, ObjectPath path, object obj, ObjectValueFlags flags)
{
try {
return CreateObjectValueImpl (ctx, source, path, obj, flags);
} catch (Exception ex) {
ctx.WriteDebuggerError (ex);
return ObjectValue.CreateFatalError (path.LastName, ex.Message, flags);
}
}