本文整理汇总了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;
}
示例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);
示例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;
}
示例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);
}
}
示例5: op_Inequality
public static bool op_Inequality(MulticastDelegate d1, MulticastDelegate d2) {}
示例6: GPTC_EventCallBack
public static extern short GPTC_EventCallBack(ushort CardNumber, ushort Enabled, ushort EventType, MulticastDelegate callbackAddr);
示例7: DIO_INT2_EventMessage
public static extern short DIO_INT2_EventMessage(ushort CardNumber, short Int2Mode, long windowHandle, long message, MulticastDelegate callbackAddr);
示例8: mg_set_uri_callback
private static extern void mg_set_uri_callback(IntPtr ctx, string uri_regex, MulticastDelegate func, IntPtr data);
示例9: Start
// ReSharper disable UnusedMember.Local
void Start()
// ReSharper restore UnusedMember.Local
{
// keys
ObjectClicked = new MulticastDelegate(Dispatcher, OBJECT_CLICKED);
}
示例10: mg_set_log_callback
private static extern void mg_set_log_callback(IntPtr ctx, MulticastDelegate func);
示例11: mg_set_log_callback
[DllImport("_mongoose",CallingConvention=CallingConvention.Cdecl)] private static extern void mg_set_log_callback(IntPtr ctx, MulticastDelegate func);
示例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;
}
示例13: DIO_T2_EventMessage
public static extern short DIO_T2_EventMessage(ushort CardNumber, short T2En, long windowHandle, uint message, MulticastDelegate callbackAddr);
示例14: NewMulticastDelegate
private MulticastDelegate NewMulticastDelegate(MulticastDelegate[] invocationList, int invocationCount)
{
MulticastDelegate result = (MulticastDelegate)this.MemberwiseClone();
result._invocationList = invocationList;
result._invocationCount = invocationCount;
return result;
}
示例15: DO_EventCallBack
public static extern short DO_EventCallBack(ushort CardNumber, short mode, short EventType, MulticastDelegate callbackAddr);