public void Cmd_Update() { if (Curr_Value.Substring(0, 1) == "=") { string a = MyFunctions.MarkReferencedCells(Curr_Value.ToUpper()); if (!Current_BTable.CheckFormulaForCircuitReference(a, Current_BTable.ActiveCell.Address)) { Current_BTable.ActiveCell.Formula = a; Current_BTable.Calculate(); Curr_Value_old = Curr_Value; Current_BTable.Cmd_Select_Referenced_Cells(); } else { JsInterop.Alert("Detected circuit reference!"); Curr_Value = Curr_Value_old; } } else { Current_BTable.ActiveCell.Value = Curr_Value; } StateHasChanged(); }
public void Cmd_Update() { if (!string.IsNullOrEmpty(Curr_Value)) { if (Curr_Value.Substring(0, 1) == "=") { string a = MyFunctions.MarkReferencedCells(Curr_Value.ToUpper()); if (!Current_BTable.CheckFormulaForCircuitReference(a, Current_BTable.ActiveCell.Address)) { Current_BTable.ActiveCell.Formula = a; Current_BTable.Calculate(); Curr_Value_old = Curr_Value; Current_BTable.Cmd_Select_Referenced_Cells(); } else { jsRuntime.InvokeVoidAsync("alert", "Detected circuit reference!"); Curr_Value = Curr_Value_old; } } else { Current_BTable.ActiveCell.Value = Curr_Value; } } else { Current_BTable.ActiveCell.Value = string.Empty; } StateHasChanged(); }