public int LoadTable(string filepath) { List <JobNode> _loadNodes; try { _loadNodes = JSSerializer.DeserializeTable(filepath); } catch (Exception e) { Logger.Log("(JS) Error while loading table: " + e.Message, Logger.MessageType.ERROR); throw new Exception("Error while loading table.", e); } lock (jsLock) { if (JobSystem.MAXNODES > _nodes.Count + _loadNodes.Count) { _nodes.AddRange(_loadNodes); } else { throw new JobSystemException("Nodes limit reached!", null); } } return(_nodes.Count); }
public void SaveNode(string fileName, int id) { lock (jsLock) { JobNode _node = LGetNode(id); if (_node != null) { JSSerializer.SerializeNode(fileName, _node); } else { throw new JobNodeException("Node does not exist!", null); } } }
public void SaveTable(string filepath) { lock (jsLock) { try { JSSerializer.SerializeTable(filepath, _nodes); } catch (Exception e) { Logger.Log("(JS) Error while saving table: " + e.Message, Logger.MessageType.ERROR); throw new Exception("Error while saving table.", e); } } }
public void LoadNode(string fileName) { JobNode _node = JSSerializer.DeserializeNode(fileName); lock (jsLock) { if (MAXNODES > _nodes.Count) { _nodes.Add(_node); } else { throw new JobSystemException("Nodes limit reached!", null); } } }