public void undo() { if (OperationDisplay != "") { OperationDisplay = OperationDisplay.Remove(OperationDisplay.Length - 1); } int openingBrackets = 0; int closingBrackets = 0; for (int i = 0; i < OperationDisplay.Length; i++) { if (OperationDisplay[i] == '(') { openingBrackets++; } if (OperationDisplay[i] == ')') { closingBrackets++; } } if (openingBrackets > closingBrackets) { string x = OperationDisplay.Substring(OperationDisplay.LastIndexOf('(')); x = x.Trim('('); x = x.Trim('-'); OperationDisplay = OperationDisplay.Remove(OperationDisplay.LastIndexOf('(')); OperationDisplay += x; } }
internal Operation(string name, OperationDisplay display, string origin, OperationPropertiesFormatServiceSpecification serviceSpecification) { Name = name; Display = display; Origin = origin; ServiceSpecification = serviceSpecification; }
internal Operation(string name, OperationDisplay display, string origin, OperationProperties properties) { Name = name; Display = display; Origin = origin; Properties = properties; }
public void signChange() { bool anyOperators = false; bool positiveSign = true; int index = 0; string x = ""; if (OperationDisplay.Length != 0 && !(OperationDisplay.LastIndexOfAny(operators.ToArray()) == OperationDisplay.Length - 1)) { for (int i = 0; i < 4; i++) { if (OperationDisplay.Contains(operators[i])) { anyOperators = true; } } if (anyOperators) { index = OperationDisplay.LastIndexOfAny(operators.ToArray()); } if (anyOperators && OperationDisplay.Substring(index - 1).Contains('(')) { positiveSign = false; } if (positiveSign) { if (index != 0) { x = OperationDisplay.Substring(index + 1); } else { x = OperationDisplay; } x = "(-" + x + ')'; if (index != 0) { OperationDisplay = OperationDisplay.Remove(index + 1); OperationDisplay += x; } else { OperationDisplay = x; } } else { x = OperationDisplay.Substring(index - 1); x = x.Trim('(', ')'); x = x.Trim('-'); OperationDisplay = OperationDisplay.Remove(index - 1); OperationDisplay += x; } } }
internal Operation(string name, bool?isDataAction, OperationDisplay display, Origin?origin, ActionType?actionType) { Name = name; IsDataAction = isDataAction; Display = display; Origin = origin; ActionType = actionType; }
public bool isNegative() { int index_oprtr = OperationDisplay.LastIndexOfAny(operators.ToArray()); int index_bracket = OperationDisplay.LastIndexOf('('); if (index_oprtr == index_bracket + 1) { return(true); } return(false); }
public bool operatorAtEnd() { bool oAE = false; for (int i = 0; i < 4; i++) { if (OperationDisplay.EndsWith(operators[i].ToString())) { oAE = true; } } return(oAE); }
public void noWrongDots() { if (((OperationDisplay.LastIndexOf('.') < OperationDisplay.LastIndexOfAny(operators.ToArray())) || (!OperationDisplay.Contains('.'))) && OperationDisplay != "") { if (OperationDisplay.LastIndexOf(')') == OperationDisplay.Length - 1) { OperationDisplay = OperationDisplay.Insert(OperationDisplay.Length - 1, "."); } else if (OperationDisplay.LastIndexOfAny(operators.ToArray()) != OperationDisplay.Length - 1) { OperationDisplay += '.'; } } }
public bool noDoubleOperators() { if (OperationDisplay.LastIndexOfAny(operators.ToArray()) == OperationDisplay.Length - 1) { OperationDisplay = OperationDisplay.Trim(operators.ToArray()); } bool anyPreviousOperations = false; for (int i = 0; i < 4; i++) { if (OperationDisplay.Contains(operators[i])) { anyPreviousOperations = true; } } return(anyPreviousOperations); }
internal Operation(string name, OperationDisplay display) { Name = name; Display = display; }
public PSOperationDisplayAttributes(OperationDisplay operationDisplay) { Provider = operationDisplay.Provider; Resource = operationDisplay.Resource; Operation = operationDisplay.Operation; }
internal OperationResult(string name, OperationDisplay display, bool?isDataAction) { Name = name; Display = display; IsDataAction = isDataAction; }