本文整理汇总了C#中Dispatch2.EnumMembers方法的典型用法代码示例。如果您正苦于以下问题:C# Dispatch2.EnumMembers方法的具体用法?C# Dispatch2.EnumMembers怎么用?C# Dispatch2.EnumMembers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dispatch2
的用法示例。
在下文中一共展示了Dispatch2.EnumMembers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Assign
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
public virtual void Assign(Dispatch2 dsp, bool clear)
{
// copy members from "dsp" to "Owner"
// determin dsp's object type
ArrayNI arrayni = null;
CustomObject owner = mOwner.Get();
if (dsp != null && (arrayni = (ArrayNI)dsp.GetNativeInstance(ArrayClass.ClassID))
!= null)
{
// convert from array
if (clear)
{
owner.Clear();
}
int count = arrayni.mItems.Count;
for (int i = 0; i < count; i++)
{
Variant v = arrayni.mItems[i];
string name = v.AsString();
i++;
if (i >= count)
{
break;
}
Variant v2 = arrayni.mItems[i];
owner.PropSet(Interface.MEMBERENSURE | Interface.IGNOREPROP, name, v2, owner);
}
}
else
{
// otherwise
if (clear)
{
owner.Clear();
}
DictionaryNI.AssignCallback callback = new DictionaryNI.AssignCallback(owner);
dsp.EnumMembers(Interface.IGNOREPROP, callback, dsp);
}
}
示例2: Assign
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
public virtual void Assign(Dispatch2 dsp)
{
// copy members from "dsp" to "Owner"
// determin dsp's object type
//Holder<ArrayNI> arrayni = new Holder<ArrayNI>(null);
ArrayNI array = (ArrayNI)dsp.GetNativeInstance(ArrayClass.ClassID);
if (array != null)
{
// copy from array
mItems.Clear();
int count = array.mItems.Count;
for (int i = 0; i < count; i++)
{
mItems.AddItem(new Variant(array.mItems[i]));
}
}
else
{
//mItems.addAll( array.mItems );
// convert from dictionary or others
mItems.Clear();
ArrayNI.DictionaryEnumCallback callback = new ArrayNI.DictionaryEnumCallback(mItems
);
dsp.EnumMembers(Interface.IGNOREPROP, callback, dsp);
}
}
示例3: AssignStructure
/// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
/// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
public virtual void AssignStructure(Dispatch2 dsp, AList<Dispatch2> stack)
{
// assign structured data from dsp
//ArrayNI dicni = null;
if (dsp.GetNativeInstance(DictionaryClass.ClassID) != null)
{
// copy from dictionary
stack.AddItem(dsp);
try
{
CustomObject owner = mOwner.Get();
owner.Clear();
DictionaryNI.AssignStructCallback callback = new DictionaryNI.AssignStructCallback
(stack, owner);
dsp.EnumMembers(Interface.IGNOREPROP, callback, dsp);
}
finally
{
stack.Remove(stack.Count - 1);
}
}
else
{
throw new TJSException(Error.SpecifyDicOrArray);
}
}