/// <summary> /// Trigger a document regeneration in the idle context or without /// depending on the state of the transaction manager. /// </summary> public static void Regenerate() { if (TransactionManager.Instance.DoAssertInIdleThread) { #if ENABLE_DYNAMO_SCHEDULER TransactionManager.Instance.EnsureInTransaction( DocumentManager.Instance.CurrentDBDocument); Instance.CurrentDBDocument.Regenerate(); // To ensure the transaction is closed in the idle process // so that the element is updated after this. TransactionManager.Instance.ForceCloseTransaction(); #else IdlePromise.ExecuteOnIdleSync(() => { TransactionManager.Instance.EnsureInTransaction( DocumentManager.Instance.CurrentDBDocument); Instance.CurrentDBDocument.Regenerate(); //To ensure the transaction is closed in the idle process //so that the element is updated after this. TransactionManager.Instance.ForceCloseTransaction(); } ); #endif } else { Instance.CurrentDBDocument.Regenerate(); } }
/// <summary> /// Trigger a document regeneration in the idle context or without /// depending on the state of the transaction manager. /// </summary> public static void Regenerate() { if (TransactionManager.Instance.DoAssertInIdleThread) { IdlePromise.ExecuteOnIdleSync(() => { TransactionManager.Instance.EnsureInTransaction( DocumentManager.Instance.CurrentDBDocument); Instance.CurrentDBDocument.Regenerate(); } ); } else { Instance.CurrentDBDocument.Regenerate(); } }
protected override void Evaluate(HomeWorkspaceModel workspace) { //Run in idle thread no matter what IdlePromise.ExecuteOnIdleSync(() => base.Evaluate(workspace)); }