public void CopyFrom(FMulticastScriptDelegate native) { Clear(); int count = native.Count; for (int i = 0; i < count; ++i) { Add(native[i]); } }
public void ProcessMulticastDelegate(IntPtr parameters) { // Create an unmanaged version of this delegate and then destroy the underlying TArray once complete FMulticastScriptDelegate scriptDelegate = new FMulticastScriptDelegate(); scriptDelegate.InvocationList.AddZeroed(Marshal.SizeOf(typeof(FScriptDelegate)), Count); for (int i = 0; i < Count; ++i) { BlittableTypeMarshaler <FScriptDelegate> .ToNative(scriptDelegate.InvocationList.Data, i, this[i]); } Native_FMulticastScriptDelegate.ProcessMulticastDelegate(ref scriptDelegate, parameters); // Something may have modified the delegate? Copy it back from the native array. CopyFrom(scriptDelegate); scriptDelegate.InvocationList.Destroy(); }
public override void FromNative(IntPtr address) { Clear(); FMulticastScriptDelegate del = *((FMulticastScriptDelegate *)address); for (int i = 0; i < del.Count; ++i) { if (IsNative) { scriptDelegatePtr->Add(del[i]); } else { managedScriptDelegate.Add(del[i]); } } }
public override void CopyFrom(FDelegateBase <TDelegate> other) { Clear(); FMulticastDelegate <TDelegate> del = other as FMulticastDelegate <TDelegate>; if (del == null) { return; } if (del.IsNative) { FMulticastScriptDelegate otherScriptDelegate = *del.scriptDelegatePtr; int count = otherScriptDelegate.Count; for (int i = 0; i < count; ++i) { if (IsNative) { scriptDelegatePtr->Add(otherScriptDelegate[i]); } else { managedScriptDelegate.Add(otherScriptDelegate[i]); } } } else { FMulticastScriptDelegateWrapper otherScriptDelegate = del.managedScriptDelegate; int count = otherScriptDelegate.Count; for (int i = 0; i < count; ++i) { if (IsNative) { scriptDelegatePtr->Add(otherScriptDelegate[i]); } else { managedScriptDelegate.Add(otherScriptDelegate[i]); } } } }