/// <summary> /// Calls <see cref="ConfigsErroredAction"/> through <see cref="UISyncContext"/>.<para/> /// This will do nothing if one or both of these is not defined. /// </summary> /// <param name="error">The error that occurred.</param> /// <param name="extraMessage">Any extra information to relay.</param> public static void ConfigsErroredThroughSync(Exception error, string extraMessage = null) { UISyncContext?.Send(callback => { ConfigsErroredAction?.Invoke(error, extraMessage); }, null); }
/// <summary> /// Calls <see cref="UpdateGUIAction"/> through <see cref="UISyncContext"/>.<para/> /// This will do nothing if one or both of these is not defined. /// </summary> public static void UpdateGUIThroughSync(string fileName = null, string isCompressed = null, string formatVersion = null, string modelType = null) { UISyncContext?.Send(callback => { UpdateGUIAction?.Invoke(fileName, isCompressed, formatVersion, modelType); }, null); }
/// <summary> /// Calls <see cref="ConfigsLoadingAction"/> through <see cref="UISyncContext"/>. Any parameters that are null implicitly mean "keep them the same" to the code.<para/> /// This will do nothing if one or both of these is not defined. /// </summary> /// <param name="numCfgsLoaded"></param> /// <param name="totalNumCfgs"></param> /// <param name="state"></param> public static void ConfigsLoadingThroughSync(int?numCfgsLoaded = null, int?totalNumCfgs = null, ProgressBarState?state = null) { UISyncContext?.Send(callback => { ConfigsLoadingAction?.Invoke(numCfgsLoaded, totalNumCfgs, state); }, null); }
/// <summary> /// Used to register the virtual data tree to the main UI /// </summary> /// <param name="lastNodeParent"></param> /// <param name="rootDataTreeObject"></param> public static void RegisterNodes(dynamic lastNodeParent, DataTreeObject rootDataTreeObject) { UISyncContext?.Send(callback => { lastNodeParent.Nodes.Add(rootDataTreeObject.ConvertHierarchyToTreeNodes()); }, null); }
/// <summary> /// Calls <see cref="ConfigsPopulatedAction"/> through <see cref="UISyncContext"/>.<para/> /// This will do nothing if one or both of these is not defined. /// </summary> public static void ConfigsPopulatedThroughSync() { UISyncContext?.Send(callback => { ConfigsPopulatedAction?.Invoke(); }, null); }