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


C# MulticastDelegate类代码示例

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


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

示例1: DeleteFromInvocationList

        private MulticastDelegate[] DeleteFromInvocationList(MulticastDelegate[] invocationList, int invocationCount, int deleteIndex, int deleteCount)
        {
            MulticastDelegate[] thisInvocationList = _invocationList;
            int allocCount = thisInvocationList.Length;
            while (allocCount / 2 >= invocationCount - deleteCount)
                allocCount /= 2;

            MulticastDelegate[] newInvocationList = new MulticastDelegate[allocCount];

            for (int i = 0; i < deleteIndex; i++)
                newInvocationList[i] = invocationList[i];

            for (int i = deleteIndex + deleteCount; i < invocationCount; i++)
                newInvocationList[i - deleteCount] = invocationList[i];

            return newInvocationList;
        }
开发者ID:afrog33k,项目名称:csnative,代码行数:17,代码来源:MulticastDelegate.cs

示例2: mg_set_uri_callback

	[DllImport("_mongoose",CallingConvention=CallingConvention.Cdecl)] private static extern void	mg_set_uri_callback(IntPtr ctx, string uri_regex, MulticastDelegate func, IntPtr data);
开发者ID:GotenXiao,项目名称:blink1,代码行数:1,代码来源:mongoose.cs

示例3: TrySetSlot

        private bool TrySetSlot(MulticastDelegate[] a, int index, MulticastDelegate o)
        {
            if (a[index] == null && System.Threading.Interlocked.CompareExchange(ref a[index], o, null) == null)
                return true;

            if (a[index] != null)
            {
                MulticastDelegate d = o;
                MulticastDelegate dd = a[index];
                if (dd._methodPtr == d._methodPtr &&
                    dd._target == d._target)
                {
                    return true;
                }
            }

            return false;
        }
开发者ID:afrog33k,项目名称:csnative,代码行数:18,代码来源:MulticastDelegate.cs

示例4: CombineImpl

        protected override Delegate CombineImpl(Delegate follow)
        {
            if (follow == null)
                return this;

            // Verify that the types are the same...
            if (this.GetType() != follow.GetType())
                throw new ArgumentException("DlgtTypeMis");

            MulticastDelegate dFollow = (MulticastDelegate)follow;
            MulticastDelegate[] resultList;
            int followCount = 1;
            MulticastDelegate[] followList = dFollow._invocationList;
            if (followList != null)
                followCount = (int)dFollow._invocationCount;

            int resultCount;
            MulticastDelegate[] invocationList = _invocationList;
            if (invocationList == null)
            {
                resultCount = 1 + followCount;
                resultList = new MulticastDelegate[resultCount];
                resultList[0] = this;
                if (followList == null)
                {
                    resultList[1] = dFollow;
                }
                else
                {
                    for (int i = 0; i < followCount; i++)
                        resultList[1 + i] = followList[i];
                }
                return NewMulticastDelegate(resultList, resultCount);
            }
            else
            {
                int invocationCount = _invocationCount;
                resultCount = invocationCount + followCount;
                resultList = null;
                if (resultCount <= invocationList.Length)
                {
                    resultList = invocationList;
                    if (followList == null)
                    {
                        if (!TrySetSlot(resultList, invocationCount, dFollow))
                            resultList = null;
                    }
                    else
                    {
                        for (int i = 0; i < followCount; i++)
                        {
                            if (!TrySetSlot(resultList, invocationCount + i, followList[i]))
                            {
                                resultList = null;
                                break;
                            }
                        }
                    }
                }

                if (resultList == null)
                {
                    int allocCount = invocationList.Length;
                    while (allocCount < resultCount)
                        allocCount *= 2;

                    resultList = new MulticastDelegate[allocCount];

                    for (int i = 0; i < invocationCount; i++)
                        resultList[i] = invocationList[i];

                    if (followList == null)
                    {
                        resultList[invocationCount] = dFollow;
                    }
                    else
                    {
                        for (int i = 0; i < followCount; i++)
                            resultList[invocationCount + i] = followList[i];
                    }
                }
                return NewMulticastDelegate(resultList, resultCount);
            }
        }
开发者ID:afrog33k,项目名称:csnative,代码行数:84,代码来源:MulticastDelegate.cs

示例5: op_Inequality

	public static bool op_Inequality(MulticastDelegate d1, MulticastDelegate d2) {}
开发者ID:Pengfei-Gao,项目名称:source-Insight-3-for-centos7,代码行数:1,代码来源:MulticastDelegate.cs

示例6: GPTC_EventCallBack

 public static extern short GPTC_EventCallBack(ushort CardNumber, ushort Enabled, ushort EventType, MulticastDelegate callbackAddr);
开发者ID:Raxtion,项目名称:CT74,代码行数:1,代码来源:Dask.cs

示例7: DIO_INT2_EventMessage

 public static extern short DIO_INT2_EventMessage(ushort CardNumber, short Int2Mode, long windowHandle, long message, MulticastDelegate callbackAddr);
开发者ID:legendmaker,项目名称:Apintec,代码行数:1,代码来源:Dask.cs

示例8: mg_set_uri_callback

 private static extern void mg_set_uri_callback(IntPtr ctx, string uri_regex, MulticastDelegate func, IntPtr data);
开发者ID:safebomb,项目名称:Webkey-1,代码行数:1,代码来源:mongoose.cs

示例9: Start

// ReSharper disable UnusedMember.Local
    void Start()
// ReSharper restore UnusedMember.Local
    {
        // keys
        ObjectClicked = new MulticastDelegate(Dispatcher, OBJECT_CLICKED);
    }
开发者ID:groov0v,项目名称:edriven-gui,代码行数:7,代码来源:EventDispatcherScript2.cs

示例10: mg_set_log_callback

 private static extern void mg_set_log_callback(IntPtr ctx, MulticastDelegate func);
开发者ID:safebomb,项目名称:Webkey-1,代码行数:1,代码来源:mongoose.cs

示例11: mg_set_log_callback

	[DllImport("_mongoose",CallingConvention=CallingConvention.Cdecl)] private static extern void	mg_set_log_callback(IntPtr ctx, MulticastDelegate func);
开发者ID:GotenXiao,项目名称:blink1,代码行数:1,代码来源:mongoose.cs

示例12: EqualInvocationLists

 private bool EqualInvocationLists(MulticastDelegate[] a, MulticastDelegate[] b, int start, int count)
 {
     for (int i = 0; i < count; i++)
     {
         if (!(a[start + i].Equals(b[i])))
             return false;
     }
     return true;
 }
开发者ID:afrog33k,项目名称:csnative,代码行数:9,代码来源:MulticastDelegate.cs

示例13: DIO_T2_EventMessage

 public static extern short DIO_T2_EventMessage(ushort CardNumber, short T2En, long windowHandle, uint message, MulticastDelegate callbackAddr);
开发者ID:legendmaker,项目名称:Apintec,代码行数:1,代码来源:Dask.cs

示例14: NewMulticastDelegate

        private MulticastDelegate NewMulticastDelegate(MulticastDelegate[] invocationList, int invocationCount)
        {
            MulticastDelegate result = (MulticastDelegate)this.MemberwiseClone();
            result._invocationList = invocationList;
            result._invocationCount = invocationCount;

            return result;
        }
开发者ID:afrog33k,项目名称:csnative,代码行数:8,代码来源:MulticastDelegate.cs

示例15: DO_EventCallBack

 public static extern short DO_EventCallBack(ushort CardNumber, short mode, short EventType, MulticastDelegate callbackAddr);
开发者ID:legendmaker,项目名称:Apintec,代码行数:1,代码来源:Dask.cs


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