Microsoft.R.Editor.Tree.EditorTree.InvokeWhenReady C# (CSharp) Method

InvokeWhenReady() public method

Provides a way to automatically invoke particular action once when tree becomes ready again. Typically used in asynchronous completion and signature help scenarios.
public InvokeWhenReady ( Action action, object p, Type type, bool processNow = false ) : void
action Action Action to invoke
p object Parameter to pass to the action
type System.Type Action identifier
processNow bool /// If true, change processing begins now. /// If false, next regular parsing pass with process pending changes. ///
return void
        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);
                }
            }
        }