本文整理汇总了C#中Kirikiri.Tjs2.Variant.SetObject方法的典型用法代码示例。如果您正苦于以下问题:C# Variant.SetObject方法的具体用法?C# Variant.SetObject怎么用?C# Variant.SetObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kirikiri.Tjs2.Variant
的用法示例。
在下文中一共展示了Variant.SetObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Callback
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
public virtual bool Callback(string name, int flags, Variant value)
{
if ((flags & Interface.HIDDENMEMBER) != 0)
{
return true;
}
if (value.IsObject())
{
// object
Dispatch2 dsp = value.AsObject();
// determin dsp's object type
Variant val;
if (dsp != null)
{
if (dsp.GetNativeInstance(DictionaryClass.ClassID) != null)
{
// dictionary
bool objrec = false;
int count = mStack.Count;
for (int i = 0; i < count; i++)
{
Dispatch2 v = mStack[i];
if (v == dsp)
{
// object recursion detected
objrec = true;
break;
}
}
val = new Variant();
if (objrec)
{
val.SetObject(null);
}
else
{
// becomes null
Dispatch2 newobj = TJS.CreateDictionaryObject();
val.SetObject(newobj, newobj);
DictionaryNI newni;
if ((newni = (DictionaryNI)newobj.GetNativeInstance(DictionaryClass.ClassID)) !=
null)
{
newni.AssignStructure(dsp, mStack);
}
}
}
else
{
if (dsp.GetNativeInstance(ArrayClass.ClassID) != null)
{
// array
bool objrec = false;
int count = mStack.Count;
for (int i = 0; i < count; i++)
{
Dispatch2 v = mStack[i];
if (v == dsp)
{
// object recursion detected
objrec = true;
break;
}
}
val = new Variant();
if (objrec)
{
val.SetObject(null);
}
else
{
// becomes null
Dispatch2 newobj = TJS.CreateArrayObject();
val.SetObject(newobj, newobj);
ArrayNI newni;
if ((newni = (ArrayNI)newobj.GetNativeInstance(ArrayClass.ClassID)) != null)
{
newni.AssignStructure(dsp, mStack);
}
}
}
else
{
val = value;
}
}
}
else
{
// other object types
val = value;
}
mDest.PropSet(Interface.MEMBERENSURE | Interface.IGNOREPROP, name, val, mDest);
}
else
{
// other types
mDest.PropSet(Interface.MEMBERENSURE | Interface.IGNOREPROP, name, value, mDest);
//.........这里部分代码省略.........