Ejemplo n.º 1
0
        private void FillSavedMapFields(TableObject tableObj)
        {
            tableObj.RectangleParamsList.ForEach(rObj => {
                switch (rObj.Type)
                {
                case RectangleType.GreenFlag: myGrid.Children.OfType <Rectangle>().Where(r => (r.Tag as RectangleParameter).GridPosition.Location == rObj.Location).FirstOrDefault().Fill = GreenFlag;
                    break;

                case RectangleType.RedFlag: myGrid.Children.OfType <Rectangle>().Where(r => (r.Tag as RectangleParameter).GridPosition.Location == rObj.Location).FirstOrDefault().Fill = RedFlag;
                    break;

                case RectangleType.GraySpace: myGrid.Children.OfType <Rectangle>().Where(r => (r.Tag as RectangleParameter).GridPosition.Location == rObj.Location).FirstOrDefault().Fill = GraySpace;
                    break;

                case RectangleType.WhiteSpace:
                    break;

                default:
                    break;
                }
                ;
            });
        }
Ejemplo n.º 2
0
        public void InitDrawGrid(TableObject tableObj = null)
        {
            try
            {
                ThreadedInfoBox TinfoBox = new ThreadedInfoBox();
                TinfoBox.Canceled += (o) => {
                    if (o == Operation.Creating)
                    {
                        this.Dispatcher.BeginInvoke(new Action(() => this.Close()));
                    }
                };
                TinfoBox.StartNewThreadInfoBox(Operation.Creating, "Creating table structure ...", this.Title);

                DrawGrid();
                if (tableObj != null)
                {
                    FillSavedMapFields(tableObj);
                }
                this.Show();

                TinfoBox.EndNewThreadInfoBox();
            }
            catch { }
        }