예제 #1
0
        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);
        }
예제 #2
0
 private string substituteValues(BoolLengthString valueString)
 {
     return(valueString.Length > 0 ? valueString.Text : "");
 }
예제 #3
0
 /// <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));
 }