/// <summary> /// Provides a way to automatically invoke particular action /// once when tree becomes ready again. Typically used in /// asynchronous completion and signature help scenarios. /// </summary> /// <param name="action">Action to invoke</param> /// <param name="p">Parameter to pass to the action</param> /// <param name="type">Action identifier</param> /// <param name="processNow"> /// If true, change processing begins now. /// If false, next regular parsing pass with process pending changes. /// </param> public void InvokeWhenReady(Action <object> action, object p, Type type, bool processNow = false) { if (IsReady) { action(p); } else { _actionsToInvokeOnReady[type] = new TreeReadyAction() { Action = action, Parameter = p }; if (processNow) { TreeUpdateTask.ProcessPendingTextBufferChanges(async: true); } } }
/// <summary> /// Provides a way to automatically invoke particular action /// once when tree becomes ready again. Typically used in /// asynchronous completion and signature help scenarios. /// </summary> /// <param name="action">Action to invoke</param> /// <param name="p">Parameter to pass to the action</param> /// <param name="type">Action identifier</param> /// <param name="processNow"> /// If true, change processing begins now. /// If false, next regular parsing pass with process pending changes. /// </param> public void InvokeWhenReady(Action<object> action, object p, Type type, bool processNow = false) { if (IsReady) { action(p); } else { _actionsToInvokeOnReady[type] = new TreeReadyAction() { Action = action, Parameter = p }; if (processNow) { TreeUpdateTask.ProcessPendingTextBufferChanges(async: true); } } }