Beispiel #1
0
        private void PaintStackLine(StackLine box)
        {
            Painter.StrokeWidth = box.StrokeWidth;
            Painter.StrokeColor = Color.Black;

            float offset = 0.01f;//when start point and end point are on X=0 line disappear then add little point

            Painter.DrawLine(
                box.StartPoint.X + box.Left + offset,
                box.StartPoint.Y + box.Top,
                box.EndPoint.X + box.Left + offset,
                box.EndPoint.Y + box.Top);
        }
                public static StackLine Parse(string line)
                {
                    StackLine res = new StackLine();

                    //Common part
                    string[] split = line.Split(' ');
                    res.Layer        = int.Parse(split[(int)Beginning.Layer]);
                    res.Size         = double.Parse(split[(int)Beginning.Size],CultureInfo.InvariantCulture);
                    res.CurrentShape = ShapeString.First(x => x.Value == split[(int)Beginning.Shape]).Key;
                    //Varying part
                    //res.Arguments = res.Arguments.Where(x => x.Indexes.ContainsKey(res.CurrentShape)).ToArray();
                    for (int i = 0; i < res.Arguments.Length; i++)
                    {
                        res.Arguments[i].Parse(res.CurrentShape,line);
                    }
                    return(res);
                }
Beispiel #3
0
    public Log(int level, int time, string scene, string message, string stack)
    {
        ID        = ++id;
        Time      = string.Format("{0:#,0}ms", time);
        Scene     = scene;
        LevelWord = level == Debug ? "D" : level == Warn ? "<color=#ffcc66>W</color>" : "<color=#ff9999>E</color>";
        Level     = level;
        Message   = message;
        Stack     = stack;
        Stacks    = new List <StackLine>();

        var lines = stack.Split('\n');

        foreach (var line in lines)
        {
            var method_file = line.Split(new string[] { ") (at " }, 2, System.StringSplitOptions.RemoveEmptyEntries);
            if (method_file.Length >= 2)
            {
                var method    = method_file[0];
                var file      = method_file[1];
                var stackLine = new StackLine(
                    file.Substring(0, file.Length - 1),
                    method.Substring(0, method.LastIndexOf('(')) + "()");
                Stacks.Add(stackLine);
            }
        }

        if (Stacks.Count > 0)
        {
            var top = Stacks[0];
            Method   = top.Method;
            FileLine = top.FileLine;
        }
        else
        {
            Method   = none;
            FileLine = none;
        }

        isGUIInit        = false;
        GUIWidthTime     = 0;
        GUIWidthScene    = 0;
        GUIWidthFileLine = 0;
        GUIWidthMethod   = 0;
    }
            public static PadStack Parse(string definition)
            {
                TextReader reader = new StringReader(definition);

                //Header
                string[] split = reader.ReadLine().Split(' ');
                PadStack res   = new PadStack();

                res.PinDesignator = split[(int)Header.PinNumber];
                int lineCount = int.Parse(split[(int)Header.StackLines]);

                //Stacklines
                res.StackLines.Capacity += lineCount;
                for (int i = 0; i < lineCount; i++)
                {
                    res.StackLines.Add(StackLine.Parse(reader.ReadLine()));
                }
                return(res);
            }