private void Session_DataRowAdded(object sender, EventArgs e) { if (InvokeRequired) { UpdateGraphDelegate d = new UpdateGraphDelegate(UpdateGraph); Invoke(d); } else { UpdateGraph(); } }
private void ResolveSession(DataSession s) { if (Config.ResolveVariables(s) && session_ == null) { ConnectToSession(s); } if (InvokeRequired) { UpdateGraphDelegate d = new UpdateGraphDelegate(UpdateGraph); Invoke(d); } else { UpdateGraph(); } }
protected bool GetContractComponentForGraph(GraphOfNodes graph, Dictionary <string, object> jsonParseResult, string ComponentName, out string message) { message = ""; object Component; jsonParseResult.TryGetValue(ComponentName, out Component); object[] list = Component as object[]; UpdateGraphDelegate UpdateGraphForComponent; switch (ComponentName) { case "Deductibles": UpdateGraphForComponent = new UpdateGraphDelegate(UpdateGraphWithDed); break; case "Sublimits": UpdateGraphForComponent = new UpdateGraphDelegate(UpdateGraphWithLim); break; case "Covers": UpdateGraphForComponent = new UpdateGraphDelegate(UpdateGraphWithCover); break; default: message = "Cannot handle financial term updates from Contract Component " + ComponentName + " at this time."; return(false); } foreach (object Obj in list) { Dictionary <string, object> Dict = Obj as Dictionary <string, object>; try { UpdateGraphForComponent(Dict, graph); } catch (InvalidOperationException e) { message = "Error getting terms for Contract Component " + ComponentName + ": " + e.Message; return(false); } } return(true); }