private static BoolLengthString LoadBoolLengthString(Stream stream) { var boolLengthString = new BoolLengthString(); boolLengthString.Use = stream.ReadInt32() != 0; if (!boolLengthString.Use) { return(boolLengthString); } boolLengthString.Length = stream.ReadInt32(); var buffer = new byte[boolLengthString.Length * 2]; stream.Read(buffer, 0, buffer.Length); boolLengthString.Text = Encoding.Unicode.GetString(buffer, 0, buffer.Length); return(boolLengthString); }
private string substituteValues(BoolLengthString valueString) { return(valueString.Length > 0 ? valueString.Text : ""); }
/// <summary> /// Обработать выражение /// </summary> /// <param name="expression"></param> /// <param name="oldParametersValue"></param> /// <returns></returns> public static float eval(BoolLengthString expression, Dictionary <int, float> oldParametersValue) { return(eval(tokenize(expression.Text), oldParametersValue)); }