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


C# Dispatch2类代码示例

本文整理汇总了C#中Dispatch2的典型用法代码示例。如果您正苦于以下问题:C# Dispatch2类的具体用法?C# Dispatch2怎么用?C# Dispatch2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Dispatch2类属于命名空间,在下文中一共展示了Dispatch2类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: CreateNew

 /// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
 /// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
 public override int CreateNew(int flag, string membername, Holder<Dispatch2> result
     , Variant[] param, Dispatch2 objthis)
 {
     // CreateNew
     Dispatch2 dsp = CreateBaseTJSObject();
     // instance initialization
     //int hr = funcCall( 0, null, null, null, dsp); // add member to dsp
     // 生成を高速化するためにメンバコピーを特别处理する形で实装
     dsp.AddClassInstanveInfo(mClassName);
     NativeInstance nativeptr = CreateNativeInstance();
     dsp.SetNativeInstance(mClassIDInternal, nativeptr);
     int hr = CopyAllMembers((CustomObject)dsp);
     if (hr < 0)
     {
         return hr;
     }
     hr = base.FuncCall(0, mClassName, null, param, dsp);
     // call constructor
     // call the constructor
     if (hr == Error.E_MEMBERNOTFOUND)
     {
         hr = Error.S_OK;
     }
     // missing constructor is OK ( is this ugly ? )
     if (hr >= 0)
     {
         result.Set(dsp);
     }
     return hr;
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:32,代码来源:NativeClass.cs

示例3: CreateNew

 // create new object
 /// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
 /// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
 public override int CreateNew(int flag, string memberName, Holder<Dispatch2> result
     , Variant[] param, Dispatch2 objThis)
 {
     if (IsNumber(memberName, Result))
     {
         return CreateNewByNum(flag, Result[0], result, param, objThis);
     }
     return base.CreateNew(flag, memberName, result, param, objThis);
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:12,代码来源:ArrayObject.cs

示例4: FuncCall

 /// <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)
 {
     if (membername != null)
     {
         return base.FuncCall(flag, membername, result, param, objthis);
     }
     return Process(result, param, objthis);
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:11,代码来源:NativeConvertedFunction.cs

示例5: DeleteMemberByNum

 /// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
 /// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
 public virtual int DeleteMemberByNum(int flag, int num, Dispatch2 objThis)
 {
     if (mObject == null)
     {
         throw new TJSException(Error.NullAccess);
     }
     return mObject.DeleteMemberByNum(flag, num, mObjThis != null ? mObjThis : (objThis
          != null ? objThis : mObject));
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:11,代码来源:VariantClosure.cs

示例6: DeleteMember

 /// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
 /// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
 public virtual int DeleteMember(int flag, string memberName, Dispatch2 objThis)
 {
     if (mObject == null)
     {
         throw new TJSException(Error.NullAccess);
     }
     return mObject.DeleteMember(flag, memberName, mObjThis != null ? mObjThis : (objThis
          != null ? objThis : mObject));
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:11,代码来源:VariantClosure.cs

示例7: CreateNewByNum

 /// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
 /// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
 public virtual int CreateNewByNum(int flag, int num, Holder<Dispatch2> result, Variant
     [] param, Dispatch2 objThis)
 {
     if (mObject == null)
     {
         throw new TJSException(Error.NullAccess);
     }
     return mObject.CreateNewByNum(flag, num, result, param, mObjThis != null ? mObjThis
          : (objThis != null ? objThis : mObject));
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:12,代码来源:VariantClosure.cs

示例8: PropSet

 public override int PropSet(int flag, string membername, Variant param, Dispatch2
     objThis)
 {
     if (membername != null)
     {
         return Error.E_MEMBERNOTFOUND;
     }
     mValue.Set(param);
     return Error.S_OK;
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:10,代码来源:SimpleGetSetProperty.cs

示例9: DeleteMember

 /// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
 /// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
 public virtual int DeleteMember(int flag, string membername, Dispatch2 objthis)
 {
     Dispatch2 OBJ1 = ((objthis != null) ? (objthis) : (mDispatch1));
     int hr = mDispatch1.DeleteMember(flag, membername, OBJ1);
     if (hr == Error.E_MEMBERNOTFOUND && mDispatch1 != mDispatch2)
     {
         Dispatch2 OBJ2 = ((objthis != null) ? (objthis) : (mDispatch2));
         return mDispatch2.DeleteMember(flag, membername, OBJ2);
     }
     return hr;
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:13,代码来源:ObjectProxy.cs

示例10: SaveStructuredDataForObject

 /// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
 /// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
 public static void SaveStructuredDataForObject(Dispatch2 dsp, AList<Dispatch2> stack
     , TextWriteStreamInterface stream, string indentstr)
 {
     // check object recursion
     int count = stack.Count;
     for (int i = 0; i < count; i++)
     {
         Dispatch2 d = stack[i];
         if (d == dsp)
         {
             // object recursion detected
             stream.Write("null /* object recursion detected */");
             return;
         }
     }
     // determin dsp's object type
     DictionaryNI dicni;
     ArrayNI arrayni;
     if (dsp != null)
     {
         dicni = (DictionaryNI)dsp.GetNativeInstance(DictionaryClass.ClassID);
         if (dicni != null)
         {
             // dictionary
             stack.AddItem(dsp);
             dicni.SaveStructuredData(stack, stream, indentstr);
             stack.Remove(stack.Count - 1);
             return;
         }
         else
         {
             arrayni = (ArrayNI)dsp.GetNativeInstance(ArrayClass.ClassID);
             if (arrayni != null)
             {
                 // array
                 stack.AddItem(dsp);
                 arrayni.SaveStructuredData(stack, stream, indentstr);
                 stack.Remove(stack.Count - 1);
                 return;
             }
             else
             {
                 // other objects
                 stream.Write("null /* (object) \"");
                 // stored as a null
                 Variant val = new Variant(dsp, dsp);
                 stream.Write(LexBase.EscapeC(val.AsString()));
                 stream.Write("\" */");
                 return;
             }
         }
     }
     stream.Write("null");
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:56,代码来源:ArrayNI.cs

示例11: CreateNew

 /// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
 /// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
 public override int CreateNew(int flag, string membername, Holder<Dispatch2> result
     , Variant[] param, Dispatch2 objthis)
 {
     int hr = base.CreateNew(flag, membername, result, param, objthis);
     if (hr == Error.E_MEMBERNOTFOUND && (flag & Interface.MEMBERMUSTEXIST) == 0)
     {
         return Error.E_INVALIDTYPE;
     }
     // call operation for void
     return hr;
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:13,代码来源:DictionaryObject.cs

示例12: IsInstanceOf

 /// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
 /// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
 public override int IsInstanceOf(int flag, string membername, string classname, Dispatch2
     objthis)
 {
     if (membername == null)
     {
         if ("Function".Equals(classname))
         {
             return Error.S_TRUE;
         }
     }
     return base.IsInstanceOf(flag, membername, classname, objthis);
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:14,代码来源:NativeConvertedFunction.cs

示例13: CreateNewByNum

 /// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
 /// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
 public virtual int CreateNewByNum(int flag, int num, Holder<Dispatch2> result, Variant
     [] param, Dispatch2 objthis)
 {
     Dispatch2 OBJ1 = ((objthis != null) ? (objthis) : (mDispatch1));
     int hr = mDispatch1.CreateNewByNum(flag, num, result, param, OBJ1);
     if (hr == Error.E_MEMBERNOTFOUND && mDispatch1 != mDispatch2)
     {
         Dispatch2 OBJ2 = ((objthis != null) ? (objthis) : (mDispatch2));
         return mDispatch2.CreateNewByNum(flag, num, result, param, OBJ2);
     }
     return hr;
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:14,代码来源:ObjectProxy.cs

示例14: PropGet

 public override int PropGet(int flag, string membername, Variant result, Dispatch2
     objthis)
 {
     if (membername != null)
     {
         return Error.E_MEMBERNOTFOUND;
     }
     if (result != null)
     {
         result.Set(mValue);
     }
     return Error.S_OK;
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:13,代码来源:SimpleGetSetProperty.cs

示例15: PropGet

 /// <exception cref="Kirikiri.Tjs2.VariantException"></exception>
 /// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
 public override int PropGet(int flag, string membername, Variant result, Dispatch2
     objthis)
 {
     int hr = base.PropGet(flag, membername, result, objthis);
     if (hr == Error.E_MEMBERNOTFOUND && (flag & Interface.MEMBERMUSTEXIST) == 0)
     {
         if (result != null)
         {
             result.Clear();
         }
         // returns void
         return Error.S_OK;
     }
     return hr;
 }
开发者ID:fantasydr,项目名称:krkr-cs,代码行数:17,代码来源:DictionaryObject.cs


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