Example #1
0
        public static Drawing Load(string path, Canvas canvas)
        {
            Drawing drawing = new Drawing(canvas);

            if (System.IO.File.Exists(path))
            {
                string text = System.IO.File.ReadAllText(path);
                DrawingDeserializer.ReadDrawing(drawing, text);
                drawing.ShowBall();

                drawing.LoadTitleBackground();

                drawing.Figures.UpdateVisual(); //07-23-2009 scott
            }
            return(drawing);
        }
Example #2
0
        public static Drawing Load(string pathObj, string pathOpp, Canvas canvas, int scoutType)
        {
            Drawing drawing = new Drawing(canvas);

            if (scoutType == 0)
            {
                if (System.IO.File.Exists(pathOpp))
                {
                    if (scoutType == 0)
                    {
                        drawing.placeHolder = true;
                    }

                    string textOpp = System.IO.File.ReadAllText(pathOpp);
                    DrawingDeserializer.ReadDrawingReverse(drawing, textOpp);
                    drawing.PointDef = drawing.GetBallPoint();

                    drawing.PlaceHolder = false;
                }

                if (System.IO.File.Exists(pathObj))
                {
                    if (scoutType == 1)
                    {
                        drawing.PlaceHolder = true;
                    }

                    drawing.MoveBall();

                    string textObj = System.IO.File.ReadAllText(pathObj);
                    DrawingDeserializer.ReadDrawing(drawing, textObj);
                    drawing.PointOff = drawing.GetBallPoint();

                    drawing.PlaceHolder = false;
                }
            }
            else if (scoutType == 1)
            {
                if (System.IO.File.Exists(pathObj))
                {
                    if (scoutType == 1)
                    {
                        drawing.PlaceHolder = true;
                    }

                    string textObj = System.IO.File.ReadAllText(pathObj);
                    DrawingDeserializer.ReadDrawing(drawing, textObj);
                    drawing.PointOff = drawing.GetBallPoint();

                    drawing.PlaceHolder = false;
                }

                if (System.IO.File.Exists(pathOpp))
                {
                    if (scoutType == 0)
                    {
                        drawing.placeHolder = true;
                    }

                    drawing.MoveBall();

                    string textOpp = System.IO.File.ReadAllText(pathOpp);
                    DrawingDeserializer.ReadDrawingReverse(drawing, textOpp);
                    drawing.PointDef = drawing.GetBallPoint();

                    drawing.PlaceHolder = false;
                }
            }

            if (scoutType == 0)
            {
                drawing.ResetDefFigures(drawing.PointDef, drawing.PointOff);
            }

            if (scoutType == 1)
            {
                drawing.ResetOffFigures(drawing.PointDef, drawing.PointOff);
            }

            drawing.ShowBall();

            drawing.LoadTitleBackground();

            drawing.Figures.UpdateVisual(); //07-23-2009 scott
            return(drawing);
        }