当前位置: 首页>>代码示例>>C#>>正文


C# Dispatch2.EnumMembers方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:41,代码来源:DictionaryNI.cs

示例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);
     }
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:28,代码来源:ArrayNI.cs

示例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);
     }
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:28,代码来源:DictionaryNI.cs


注:本文中的Dispatch2.EnumMembers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。