public void MediumTruckState() { mQuoteState = QuoteState.MediumTruck; SetBrushesToBase(); MediumTruckButtonBrush = MediumTruckBrush; CalcQuickQuote(); }
public void PassengerState() { mQuoteState = QuoteState.Passenger; SetBrushesToBase(); PassengerButtonBrush = PassengerBrush; CalcQuickQuote(); }
public void LawnState() { mQuoteState = QuoteState.Lawn; SetBrushesToBase(); LawnButtonBrush = LawnBrush; CalcQuickQuote(); }
public ParserStateMachine() { context = new global::ParserContext(); LineStartState = new LineStartState(this); ValueStartState = new ValueStartState(this); ValueState = new ValueState(this); QuotedValueState = new QuotedValueState(this); QuoteState = new QuoteState(this); }
public ParserStateMachine(bool TrimTrailingEmptyLines = false, int MaxColumnsToRead = 0) { this.TrimTrailingEmptyLines = TrimTrailingEmptyLines; this.MaxColumnsToRead = MaxColumnsToRead; context = new global::ParserContext(); LineStartState = new LineStartState(this); ValueStartState = new ValueStartState(this); ValueState = new ValueState(this); QuotedValueState = new QuotedValueState(this); QuoteState = new QuoteState(this); }
private static string Dequote(string s) { var sb = new StringBuilder(s.Length); bool isEscaped = false; QuoteState quoteState = QuoteState.None; foreach (char c in s) { switch (c) { case '"': if (isEscaped || quoteState == QuoteState.Single) { sb.Append(c); break; } quoteState ^= QuoteState.Double; break; case '\'': if (isEscaped || quoteState == QuoteState.Double) { sb.Append(c); break; } quoteState ^= QuoteState.Single; break; case '\\': if (isEscaped) { sb.Append(c); break; } isEscaped = true; // Continue here so we don't immediately unset continue; default: sb.Append(c); break; } isEscaped = false; } return(sb.ToString()); }
/// <summary> /// Calculates the prices based on settings and Markup Range /// </summary> /// <returns></returns> public static void Calculate(QuoteState quoteState) { decimal Labor; switch (quoteState) { case QuoteState.Lawn: Labor = Settings.LawnLaborRate; break; case QuoteState.Passenger: Labor = Settings.PassengerLaborRate; break; case QuoteState.MediumTruck: Labor = Settings.MediumTruckLaborRate; break; default: Labor = 16M; break; } //>>>>>>>>>>>>>>>>Rework to calculate based on taxed or taxed exempt /* * for (int i = 0; i < 6; i++) * { * allResults[i] = (Cost * Markup * (i + 1)) + (Labor * (i + 1)) + (Labor * (i + 1) * Settings.ServiceFeeRate); * } * for (int i = 6; i < 12; i++) * { * allResults[i] = (Cost * Markup + (Labor * Settings.ServiceFeeRate)) * (i - 5) * Settings.TaxRate + (Labor * (i - 5)); * } */ }