public TableObject GetMyMapData() { List <ExportImport.RectangleParams> RectangleParamsList = new List <ExportImport.RectangleParams>(); myGrid.Children.OfType <Rectangle>().ToList(). ForEach(r => RectangleParamsList.Add(new ExportImport.RectangleParams() { X = (r.Tag as RectangleParameter).GridPosition.X, Y = (r.Tag as RectangleParameter).GridPosition.Y, Type = MapExporterImporter.FindType(r) })); return(new TableObject(this.Title, rowCount, colCount, AnimationSpeed, UncertaintyLevel, BackPathType, RectangleParamsList)); }
private void MapOpen_Click(object sender, RoutedEventArgs e) { tableObj = MapExporterImporter.ImportFromXML((sender as MenuItem).Name); if (tableObj != null) { txtName.Text = tableObj.TableTitle; txtRows.Text = tableObj.RowCount.ToString(); txtCols.Text = tableObj.ColCount.ToString(); txtAnimationSpeed.Text = tableObj.AnimationSpeed.ToString(); slider.Value = tableObj.UncertaintyLevel; Shortest.IsChecked = (tableObj.BackPathType == BackPathType.Shortest) ? true : false; Reversed.IsChecked = (tableObj.BackPathType == BackPathType.Reversed) ? true : false; BackPathType = tableObj.BackPathType; btnCreate_Click(null, null); } }