//// 09-15-2010 Scott //public static Drawing LoadByScoutType(string path, int scoutType, Canvas canvas) //{ // Drawing drawing = new Drawing(canvas); // string text = System.IO.File.ReadAllText(path); // DrawingDeserializer.ReadDrawing(drawing, text); // drawing.Figures.UpdateVisual(); //07-23-2009 scott // return drawing; //} public static Drawing Load(string pathObj, string pathOpp, Canvas canvas) { Drawing drawing = new Drawing(canvas); // 08-18-2011 Scott if (System.IO.File.Exists(pathOpp)) { string textOpp = System.IO.File.ReadAllText(pathOpp); DrawingDeserializer.ReadDrawingUpTeam(drawing, textOpp); drawing.PointDef = drawing.GetBallPoint(); } if (System.IO.File.Exists(pathObj)) { drawing.MoveBall(); string textObj = System.IO.File.ReadAllText(pathObj); DrawingDeserializer.ReadDrawingBottomTeam(drawing, textObj); drawing.PointOff = drawing.GetBallPoint(); drawing.ResetDefFigures(drawing.pointdef, drawing.PointOff); } drawing.ShowBall(); drawing.LoadTitleBackground(); drawing.Figures.UpdateVisual(); //07-23-2009 scott return(drawing); }
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); }