本文整理汇总了C#中mdr.GetPropertyDescriptor方法的典型用法代码示例。如果您正苦于以下问题:C# mdr.GetPropertyDescriptor方法的具体用法?C# mdr.GetPropertyDescriptor怎么用?C# mdr.GetPropertyDescriptor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mdr
的用法示例。
在下文中一共展示了mdr.GetPropertyDescriptor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetEventHandlerAttr
public static string GetEventHandlerAttr(mdr.DObject obj, string name)
{
var ehp = obj.GetPropertyDescriptor(name).GetProperty() as EventHandlerProperty;
if (ehp == null)
throw new Exception("Invalid Event " + name);
return GetEventHandlerAttr(obj, ehp.EventType, name);
}
示例2: CallProperty
public static bool CallProperty(mdr.DObject input, string propName, out mdr.DValue output)
{
if (input != null)
{
var propDesc = input.GetPropertyDescriptor(propName);
var prop = new mdr.DValue();
propDesc.Get(input, ref prop);
mdr.DFunction func = null;
if (prop.ValueType == mdr.ValueTypes.Function)
{
func = prop.AsDFunction();
//if (toString != null)
//{
mdr.CallFrame callFrame = new mdr.CallFrame();
callFrame.This = (input);
callFrame.Function = func;
func.Call(ref callFrame);
if (ValueTypesHelper.IsPrimitive(callFrame.Return.ValueType))
{
output = callFrame.Return;
return true;
}
}
}
output = new mdr.DValue();
output.SetUndefined();
return false;
}
示例3: SetEventHandlerAttr
public static void SetEventHandlerAttr(mdr.DObject obj, string name, string script)
{
#if ENABLE_RR
if (RecordReplayManager.Instance != null && RecordReplayManager.Instance.RecordEnabled)
{
RecordReplayManager.Instance.Record("Element", null, "SetEventHandlerAttr", false, obj, name, script);
}
#endif
var ehp = obj.GetPropertyDescriptor(name).GetProperty() as EventHandlerProperty;
if (ehp == null)
throw new Exception("Invalid Event " + name);
SetEventHandlerAttr(obj, ehp.EventType, name, script);
}
示例4: fillArray
private void fillArray(DInt8Array dst, mdr.DArrayBase src)
{
for (int i = 0; i < dst.ByteLength / dst.TypeSize; ++i)
{
byte value = (byte)src.GetPropertyDescriptor(i).Get(src).AsInt8();
dst.AddPropertyDescriptor(i).Set(dst, value);
}
}
示例5: fillArray
private void fillArray(DUint32Array dst, mdr.DArrayBase src)
{
for (int i = 0; i < dst.ByteLength / dst.TypeSize; ++i)
{
UInt32 value = src.GetPropertyDescriptor(i).Get(src).AsUInt32();
dst.AddPropertyDescriptor(i).Set(dst, value);
}
}