本文整理汇总了C#中IObjectValueSource类的典型用法代码示例。如果您正苦于以下问题:C# IObjectValueSource类的具体用法?C# IObjectValueSource怎么用?C# IObjectValueSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IObjectValueSource类属于命名空间,在下文中一共展示了IObjectValueSource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
static ObjectValue Create (IObjectValueSource source, ObjectPath path, string typeName)
{
ObjectValue ob = new ObjectValue ();
ob.source = source;
ob.path = path;
ob.typeName = typeName;
return ob;
}
示例2: Create
static ObjectValue Create (IObjectValueSource source, ObjectPath path, string typeName)
{
var val = new ObjectValue ();
val.typeName = typeName;
val.source = source;
val.path = path;
return val;
}
示例3: 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);
}
}
示例4: CreateObject
public static ObjectValue CreateObject (IObjectValueSource source, ObjectPath path, string typeName, EvaluationResult value, ObjectValueFlags flags, ObjectValue[] children)
{
ObjectValue ob = Create (source, path, typeName);
ob.path = path;
ob.flags = flags | ObjectValueFlags.Object;
ob.value = value.Value;
ob.displayValue = value.DisplayValue;
if (children != null) {
ob.children = new List<ObjectValue> ();
ob.children.AddRange (children);
}
return ob;
}
示例5: CreatePrimitive
public static ObjectValue CreatePrimitive (IObjectValueSource source, ObjectPath path, string typeName, EvaluationResult value, ObjectValueFlags flags)
{
ObjectValue ob = Create (source, path, typeName);
ob.flags = flags | ObjectValueFlags.Primitive;
ob.value = value.Value;
ob.displayValue = value.DisplayValue;
return ob;
}
示例6: CreateNotSupported
public static ObjectValue CreateNotSupported (IObjectValueSource source, ObjectPath path, string typeName, string message, ObjectValueFlags flags)
{
ObjectValue ob = Create (source, path, typeName);
ob.flags = flags | ObjectValueFlags.NotSupported;
ob.value = message;
return ob;
}
示例7: CreateEvaluationException
public static ObjectValue CreateEvaluationException(EvaluationContext ctx, IObjectValueSource source, ObjectPath path, EvaluatorExceptionThrownException exception,
ObjectValueFlags flags = ObjectValueFlags.None)
{
var error = CreateError (source, path, exception.ExceptionTypeName, "Exception was thrown", flags);
var exceptionReference = LiteralValueReference.CreateTargetObjectLiteral (ctx, "Exception", exception.Exception);
var exceptionValue = exceptionReference.CreateObjectValue (ctx.Options);
error.children = new List<ObjectValue> {exceptionValue};
return error;
}
示例8: CreateError
public static ObjectValue CreateError (IObjectValueSource source, ObjectPath path, string typeName, string value, ObjectValueFlags flags)
{
ObjectValue ob = Create (source, path, typeName);
ob.flags = flags | ObjectValueFlags.Error;
ob.value = value;
return ob;
}
示例9: CreateImplicitNotSupported
public static ObjectValue CreateImplicitNotSupported (IObjectValueSource source, ObjectPath path, string typeName, ObjectValueFlags flags)
{
return CreateNotSupported (source, path, typeName, "Implicit evaluation is disabled", flags);
}
示例10: CreateNotSupported
public static ObjectValue CreateNotSupported(IObjectValueSource source, ObjectPath path, string typeName, string message, ObjectValueFlags flags)
{
var val = Create (source, path, typeName);
val.flags = flags | ObjectValueFlags.NotSupported;
val.value = message;
return val;
}
示例11: CreateError
public static ObjectValue CreateError(IObjectValueSource source, ObjectPath path, string typeName, string value, ObjectValueFlags flags)
{
var val = Create (source, path, typeName);
val.flags = flags | ObjectValueFlags.Error;
val.value = value;
return val;
}
示例12: CreateNullObject
public static ObjectValue CreateNullObject (IObjectValueSource source, string name, string typeName, ObjectValueFlags flags)
{
ObjectValue ob = Create (source, new ObjectPath (name), typeName);
ob.flags = flags | ObjectValueFlags.Object;
ob.value = "(null)";
return ob;
}
示例13: CreateNullObject
public static ObjectValue CreateNullObject (IObjectValueSource source, string name, string typeName, ObjectValueFlags flags)
{
return CreateNullObject (source, new ObjectPath (name), typeName, flags);
}
示例14: MtaObjectValueSource
public MtaObjectValueSource (IObjectValueSource s)
{
source = s;
}
示例15: CreateObjectValueImpl
protected override ObjectValue CreateObjectValueImpl (EvaluationContext gctx, IObjectValueSource source, ObjectPath path, object vobj, ObjectValueFlags flags)
{
MdbEvaluationContext ctx = (MdbEvaluationContext) gctx;
TargetObject obj = ctx.GetRealObject (vobj);
if (obj == null)
return ObjectValue.CreateObject (null, path, "", "", flags | ObjectValueFlags.ReadOnly, null);
if (obj.HasAddress && obj.GetAddress (ctx.Thread).IsNull)
return ObjectValue.CreateObject (null, path, obj.TypeName, ctx.Evaluator.ToExpression (ctx, null), flags, null);
switch (obj.Kind) {
case TargetObjectKind.Struct:
case TargetObjectKind.GenericInstance:
case TargetObjectKind.Class:
case TargetObjectKind.Array:
case TargetObjectKind.Fundamental:
case TargetObjectKind.Enum:
return base.CreateObjectValueImpl (gctx, source, path, vobj, flags);
case TargetObjectKind.Object:
TargetObjectObject oob = obj as TargetObjectObject;
if (oob == null)
return ObjectValue.CreateUnknown (path.LastName);
else
return ObjectValue.CreateObject (source, path, obj.TypeName, Server.Instance.Evaluator.TargetObjectToExpression (ctx, obj), flags, null);
case TargetObjectKind.Pointer:
return ObjectValue.CreateObject (source, path, obj.TypeName, Server.Instance.Evaluator.TargetObjectToExpression (ctx, obj), flags, null);
case TargetObjectKind.Nullable:
TargetNullableObject tn = (TargetNullableObject) obj;
if (tn.HasValue (ctx.Thread)) {
ObjectValue val = CreateObjectValue (ctx, source, path, tn.GetValue (ctx.Thread), flags);
val.TypeName = obj.TypeName;
return val;
}
else {
flags |= ObjectValueFlags.Primitive;
return ObjectValue.CreateObject (source, path, obj.TypeName, ctx.Evaluator.ToExpression (ctx, null), flags, new ObjectValue [0]);
}
default:
return ObjectValue.CreateFatalError (path.LastName, "Unknown value type: " + obj.Kind, flags);
}
}