public void Remove(FScriptDelegate value) { int index = IndexOf(value); if (index >= 0) { RemoveAt(index); } }
public override void FromNative(IntPtr address) { Clear(); FScriptDelegate del = *((FScriptDelegate *)address); if (IsNative) { *scriptDelegatePtr = del; } else { managedScriptDelegate = del; } }
public int IndexOf(IntPtr obj, FName functionName) { int count = Count; for (int i = 0; i < count; ++i) { FScriptDelegate scriptDelegate = this[i]; if (scriptDelegate.Object.GetPtrEvenIfUnreachable() == obj && scriptDelegate.FunctionName == functionName) { return(i); } } return(-1); }
public int IndexOf(FScriptDelegate value) { EqualityComparer <FScriptDelegate> comparer = EqualityComparer <FScriptDelegate> .Default; int count = Count; for (int i = 0; i < count; ++i) { if (comparer.Equals(this[i], value)) { return(i); } } return(-1); }
/// <summary> /// Checks to see if any functions are bound to the given user object. /// </summary> /// <param name="obj">The UObject derived object to check</param> /// <returns>True if any functions are bound to the given object, false otherwise.</returns> public bool IsBoundToObject(IntPtr obj) { if (obj == IntPtr.Zero) { return(false); } int count = Count; for (int i = 0; i < count; ++i) { FScriptDelegate scriptDelegate = this[i]; if (scriptDelegate.Object.GetPtrEvenIfUnreachable() == obj) { return(true); } } return(false); }
public FScriptDelegate[] GetFunctionInfos() { FScriptDelegate[] result = new FScriptDelegate[Count]; if (IsNative) { for (int i = 0; i < result.Length; i++) { result[i] = (*scriptDelegatePtr)[i]; } } else { for (int i = 0; i < result.Length; i++) { result[i] = managedScriptDelegate[i]; } } return(result); }
public override void CopyFrom(FDelegateBase <TDelegate> other) { Clear(); FDelegate <TDelegate> del = other as FDelegate <TDelegate>; if (del == null) { return; } FScriptDelegate otherScriptDelegate = del.IsNative ? *del.scriptDelegatePtr : managedScriptDelegate; if (IsNative) { scriptDelegatePtr->Bind(otherScriptDelegate.Object.GetPtr(), otherScriptDelegate.FunctionName); } else { managedScriptDelegate.Bind(otherScriptDelegate.Object.GetPtr(), otherScriptDelegate.FunctionName); } }
public bool Contains(FScriptDelegate value) { return(IndexOf(value) >= 0); }
public int IndexOf(FScriptDelegate value) { return(Delegates.IndexOf(value)); }
public void Add(FScriptDelegate value) { Delegates.Add(value); }
public void Add(FScriptDelegate value) { this[InvocationList.AddZeroed(ElementSize)] = value; }
public void Set(int index, FScriptDelegate value) { this[index] = value; }