void IUIWidget.OnOperationChange(Shared.Core.Operation operation) { string lineOne = null; if (!string.IsNullOrWhiteSpace(_expressionLineOne)) { lineOne = operation != null?operation.ToString(_expressionLineOne) : "(n/A)"; } string lineTwo = null; if (!string.IsNullOrWhiteSpace(_expressionLineTwo)) { lineTwo = operation != null?operation.ToString(_expressionLineTwo) : "(n/A)"; } string lineThree = null; if (!string.IsNullOrWhiteSpace(_expressionLineThree)) { lineThree = operation != null?operation.ToString(_expressionLineThree) : "(n/A)"; } LineOne.Inlines.Clear(); LineTwo.Inlines.Clear(); LineThree.Inlines.Clear(); LineOne.Inlines.Add(Helper.Execute(lineOne)); LineTwo.Inlines.Add(Helper.Execute(lineTwo)); LineThree.Inlines.Add(Helper.Execute(lineThree)); }
private string FormatLine(string expression, Shared.Core.Operation operation) { if (!string.IsNullOrWhiteSpace(expression)) { try { return(operation != null?operation.ToString(expression) : "(n/A)"); } catch (AssertionFailedException) { // This exception may occure if the format of the value is broken or other problems with the format exist... return(string.Empty); } } return(string.Empty); }