本文整理汇总了C#中Kirikiri.Tjs2.Variant.ChangeClosureObjThis方法的典型用法代码示例。如果您正苦于以下问题:C# Variant.ChangeClosureObjThis方法的具体用法?C# Variant.ChangeClosureObjThis怎么用?C# Variant.ChangeClosureObjThis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kirikiri.Tjs2.Variant
的用法示例。
在下文中一共展示了Variant.ChangeClosureObjThis方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FuncCall
//private Callback mCallback;
//private VariantClosure mCallbackClosure;
// a class to receive member callback from class
// destination object
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
public override int FuncCall(int flag, string membername, Variant result, Variant
[] param, Dispatch2 objthis)
{
// *param[0] = name *param[1] = flags *param[2] = value
int flags = param[1].AsInteger();
if ((flags & Interface.STATICMEMBER) == 0)
{
Variant val = new Variant(param[2]);
if (val.IsObject())
{
// change object's objthis if the object's objthis is null
if (val.AsObjectThis() == null)
{
val.ChangeClosureObjThis(mDest);
}
}
mDest.PropSet(Interface.MEMBERENSURE | Interface.IGNOREPROP | flags, param[0].AsString
(), val, mDest);
}
if (result != null)
{
result.Set(1);
}
// returns true
return Error.S_OK;
}
示例2: CopyAllMembers
/// <summary>new する时のメンバコピー</summary>
/// <param name="dest">コピー先</param>
/// <returns>エラーコード</returns>
/// <exception cref="TJSException">TJSException</exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
protected internal virtual int CopyAllMembers(Kirikiri.Tjs2.CustomObject dest)
{
if (!GetValidity())
{
return Error.E_INVALIDOBJECT;
}
if (!dest.GetValidity())
{
return Error.E_INVALIDOBJECT;
}
Variant result = new Variant();
for (int i = 0; i < mHashSize; i++)
{
SymbolData lv1 = mSymbols[i];
SymbolData d = lv1.mNext;
while (d != null)
{
SymbolData nextd = d.mNext;
if (((d.mSymFlags & SYMBOL_USING) != 0) && ((d.mSymFlags & SYMBOL_STATIC) == 0))
{
if (d.mValue.IsObject())
{
result.Set(d.mValue);
if (result.AsObjectThis() == null)
{
result.ChangeClosureObjThis(dest);
}
SymbolData data = dest.Add(d.mName);
if ((d.mSymFlags & SYMBOL_HIDDEN) != 0)
{
data.mSymFlags |= SYMBOL_HIDDEN;
}
else
{
data.mSymFlags &= ~SYMBOL_HIDDEN;
}
data.mValue.CopyRef(result);
}
}
d = nextd;
}
if (((lv1.mSymFlags & SYMBOL_USING) != 0) && ((lv1.mSymFlags & SYMBOL_STATIC) ==
0))
{
if (lv1.mValue.IsObject())
{
result.Set(lv1.mValue);
if (result.AsObjectThis() == null)
{
result.ChangeClosureObjThis(dest);
}
SymbolData data = dest.Add(lv1.mName);
if ((lv1.mSymFlags & SYMBOL_HIDDEN) != 0)
{
data.mSymFlags |= SYMBOL_HIDDEN;
}
else
{
data.mSymFlags &= ~SYMBOL_HIDDEN;
}
data.mValue.CopyRef(result);
}
}
}
return Error.S_OK;
}