internal static void SerializeDelegateField(SerializeContext context, BinaryWriter bw, MulticastDelegate d, Type delegateType) { Debug.Assert(delegateType.BaseType == typeof(MulticastDelegate)); if (d == null) { bw.Write(0); return; } var invocationList = d.GetInvocationListDirect(); bw.WriteSmallInt32(invocationList.Count); foreach (var invocation in invocationList) { SerializeDelegate(context, bw, invocation, delegateType); } }