本文整理汇总了C#中ObjectValueFlags类的典型用法代码示例。如果您正苦于以下问题:C# ObjectValueFlags类的具体用法?C# ObjectValueFlags怎么用?C# ObjectValueFlags使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectValueFlags类属于命名空间,在下文中一共展示了ObjectValueFlags类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFlags
internal static ObjectValueFlags GetFlags (PropertyInfoMirror property, MethodMirror getter)
{
var flags = ObjectValueFlags.Property;
if (property.GetSetMethod (true) == null)
flags |= ObjectValueFlags.ReadOnly;
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
return flags;
}
示例2: VariableValueReference
public VariableValueReference (EvaluationContext ctx, CorValRef var, string name, ObjectValueFlags flags)
: base (ctx)
{
this.flags = flags;
this.var = var;
this.name = name;
}
示例3: 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
}
示例4: Run
public ObjectValue Run (string name, ObjectValueFlags flags, ObjectEvaluatorDelegate evaluator)
{
string id;
int tid;
lock (asyncCallbacks) {
tid = asyncCounter++;
id = tid.ToString ();
}
ObjectValue val = null;
bool done = runner.Run (delegate {
if (tid >= cancelTimestamp)
val = evaluator ();
},
delegate {
if (tid >= cancelTimestamp)
OnEvaluationDone (id, val);
});
if (done) {
// 'val' may be null if the timed evaluator is disposed while evaluating
return val ?? ObjectValue.CreateUnknown (name);
}
return ObjectValue.CreateEvaluating (this, new ObjectPath (id, name), flags);
}
示例5: 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);
}
}
示例6: 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;
}
示例7: FieldReference
public FieldReference (EvaluationContext ctx, CorValRef thisobj, CorType type, FieldInfo field, string vname, ObjectValueFlags vflags) : base (ctx)
{
this.thisobj = thisobj;
this.type = type;
this.field = field;
this.vname = vname;
if (field.IsStatic)
this.thisobj = null;
flags = vflags | GetFlags (field);
loader = delegate {
return ((CorValRef)Value).Val;
};
}
示例8: FieldValueReference
public FieldValueReference (EvaluationContext ctx, FieldInfoMirror field, object obj, TypeMirror declaringType, string vname, ObjectValueFlags vflags): base (ctx)
{
this.field = field;
this.obj = obj;
this.declaringType = declaringType;
this.vname = vname;
flags = vflags;
if (field.IsStatic)
this.obj = null;
flags |= GetFlags (field);
if (obj is PrimitiveValue)
flags |= ObjectValueFlags.ReadOnly;
}
示例9: GetFlags
internal static ObjectValueFlags GetFlags (FieldInfoMirror field)
{
var flags = ObjectValueFlags.Field;
if (field.IsStatic)
flags |= ObjectValueFlags.Global;
if (field.IsPublic)
flags |= ObjectValueFlags.Public;
else if (field.IsPrivate)
flags |= ObjectValueFlags.Private;
else if (field.IsFamily)
flags |= ObjectValueFlags.Protected;
else if (field.IsFamilyAndAssembly)
flags |= ObjectValueFlags.Internal;
else if (field.IsFamilyOrAssembly)
flags |= ObjectValueFlags.InternalProtected;
return flags;
}
示例10: FieldValueReference
public FieldValueReference (EvaluationContext ctx, FieldInfoMirror field, object obj, TypeMirror declaringType, string vname, ObjectValueFlags vflags, FieldReferenceBatch batch = null): base (ctx)
{
this.field = field;
this.obj = obj;
this.declaringType = declaringType;
this.vname = vname;
this.batch = batch;
flags = vflags;
if (field.IsStatic)
this.obj = null;
var objectMirror = obj as ObjectMirror;
if (objectMirror != null)
EnsureContextHasDomain (objectMirror.Domain);
flags |= GetFlags (field);
if (obj is PrimitiveValue)
flags |= ObjectValueFlags.ReadOnly;
}
示例11: Run
public ObjectValue Run (string name, ObjectValueFlags flags, ObjectEvaluatorDelegate evaluator)
{
string id;
int tid;
lock (asyncCallbacks) {
tid = asyncCounter++;
id = tid.ToString ();
}
ObjectValue val = null;
bool done = runner.Run (delegate {
if (tid >= cancelTimestamp)
val = evaluator ();
},
delegate {
if (tid >= cancelTimestamp)
OnEvaluationDone (id, val);
});
if (done)
return val;
else
return ObjectValue.CreateEvaluating (this, new ObjectPath (id, name), flags);
}
示例12: FieldValueReference
public FieldValueReference (EvaluationContext ctx, FieldInfoMirror field, object obj, TypeMirror declaringType, string vname, ObjectValueFlags vflags): base (ctx)
{
this.field = field;
this.obj = obj;
this.declaringType = declaringType;
this.vname = vname;
flags = vflags;
if (field.IsStatic) {
flags |= ObjectValueFlags.Global;
this.obj = null;
}
if (field.IsPublic)
flags |= ObjectValueFlags.Public;
else if (field.IsPrivate)
flags |= ObjectValueFlags.Private;
else if (field.IsFamily)
flags |= ObjectValueFlags.Protected;
else if (field.IsFamilyAndAssembly)
flags |= ObjectValueFlags.Internal;
else if (field.IsFamilyOrAssembly)
flags |= ObjectValueFlags.InternalProtected;
if (obj is PrimitiveValue)
flags |= ObjectValueFlags.ReadOnly;
}
示例13: CreateImplicitNotSupported
public static ObjectValue CreateImplicitNotSupported (IObjectValueSource source, ObjectPath path, string typeName, ObjectValueFlags flags)
{
return CreateNotSupported (source, path, typeName, "Implicit evaluation is disabled", flags);
}
示例14: 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;
}
示例15: CreateArray
public static ObjectValue CreateArray (IObjectValueSource source, ObjectPath path, string typeName, int arrayCount, ObjectValueFlags flags, ObjectValue[] children)
{
ObjectValue ob = Create (source, path, typeName);
ob.arrayCount = arrayCount;
ob.flags = flags | ObjectValueFlags.Array;
ob.value = "[" + arrayCount + "]";
if (children != null && children.Length > 0) {
ob.children = new List<ObjectValue> ();
ob.children.AddRange (children);
}
return ob;
}