protected virtual void OnRequestRectChange(Node sender, RequestRectChangeEventArg arg) { // Make a temporary copy of the event to avoid possibility of // a race condition if the last subscriber unsubscribes // immediately after the null check and before the event is raised. var handler = RequestRectChange; if (handler != null) { handler?.Invoke(sender, arg); } }
protected virtual void OnChildRequestRectChange(object sender, RequestRectChangeEventArg args) { var i = Childs.IndexOf(args.Requester); if (i >= 0) { Childs[i].FixedRect = true; } RecalcDeltaWithHeight(); if (!TryUpdateChildRect(0, Childs.Count, out RECT newRect)) { base.UpdateRect(newRect); RecalcDeltaWithHeight(); OnRequestRectChange(this, new RequestRectChangeEventArg(this, Rect, newRect)); } }