예제 #1
0
        private void LoadItemsWoker_DoWork(object sender, DoWorkEventArgs e)
        {
            //1st - Get from DB all data to fill the grid and save it on the list
            //Fetch this item data from DB
            ViewerTreeItemDescriptor selectedItem = Viewer.I.SelectedItem;

            _arrayDBValues = App.DB.GetAllDataOfAnItemFromMemory(selectedItem.PrimaryKeyValue, selectedItem.PrimaryKeyName, selectedItem.TableName);
            //Fill a list with the data so it can be shown on the DataGrid
            foreach (object columnValue in _arrayDBValues)
            {
                _dataGridItems.Add(new ViewerDataGridItem(DBTableAttributtesFetcher.GetColumnsNames(EDBTable.eItemTypes)[_dataGridItems.Count], columnValue));
            }
            //2nd - Set the checked item mode
            Dispatcher.BeginInvoke(new Action(() =>
            {
                switch (_itemMode)
                {
                case EItemMode.eEmpty:
                    RadioButtonEmpty.IsChecked = true;
                    break;

                case EItemMode.eFull:
                    RadioButtonFull.IsChecked = true;
                    break;
                }
            }));
            //3rd - Display the information on canvas
            CreateUpdateCanvas();
        }
예제 #2
0
        private void LoadItemsWoker_DoWork(object sender, DoWorkEventArgs e)
        {
            //1st - Get from DB all data to fill the grid and save it on the list
            //Fetch this item data from DB
            ViewerTreeItemDescriptor selectedItem = Viewer.I.SelectedItem;

            _arrayDBValues = App.DB.GetAllDataOfAnItemFromMemory(selectedItem.PrimaryKeyValue, selectedItem.PrimaryKeyName, selectedItem.TableName);
            //Fill a list with the data so it can be shown on the DataGrid
            foreach (object columnValue in _arrayDBValues)
            {
                _dataGridItems.Add(new ViewerDataGridItem(DBTableAttributtesFetcher.GetColumnsNames(EDBTable.eBarterHexes)[_dataGridItems.Count], columnValue));
            }
            //3rd - Display the information on canvas
            CreateUpdateCanvas();
        }
예제 #3
0
        private void LoadItemsWoker_DoWork(object sender, DoWorkEventArgs e)
        {
            //1st - Get from DB all data to fill the grid and save it on the list
            //Fetch this item data from DB
            ViewerTreeItemDescriptor selectedItem = Viewer.I.SelectedItem;

            _arrayDBValues = App.DB.GetAllDataOfAnItemFromMemory(selectedItem.PrimaryKeyValue, selectedItem.PrimaryKeyName, selectedItem.TableName);
            //Fill a list with the data so it can be shown on the DataGrid
            foreach (object columnValue in _arrayDBValues)
            {
                _dataGridItems.Add(new ViewerDataGridItem(DBTableAttributtesFetcher.GetColumnsNames(EDBTable.eImages)[_dataGridItems.Count], columnValue));
            }
            //2nd - Display the information on canvas
            string strSmallImagePath = _arrayDBValues[(int)EDBImagesTableColumns.eSmall].ToString();
            string strBigImagePath   = _arrayDBValues[(int)EDBImagesTableColumns.eBig].ToString();

            //Let's add the small image representation if it exists
            if (string.IsNullOrEmpty(strSmallImagePath) == false && System.IO.File.Exists(strSmallImagePath) == true)
            {
                //Create the small image panel in the GUI thread and add it to the grid on the correct place
                Dispatcher.BeginInvoke(new Action(() =>
                {
                    Panel panelSmallImage = CreateImagePanel("Small image representation:", strSmallImagePath);
                    _gridCanvas.Children.Add(panelSmallImage);
                    int nColumnIndex = _gridCanvas.ColumnDefinitions.Count;
                    _gridCanvas.ColumnDefinitions.Add(new ColumnDefinition());
                    Grid.SetColumn(panelSmallImage, nColumnIndex);
                }));
            }
            if (string.IsNullOrEmpty(strBigImagePath) == false && System.IO.File.Exists(strBigImagePath) == true)
            {
                //Create the big image panel in the GUI thread and add it to the grid on the correct place
                Dispatcher.BeginInvoke(new Action(() =>
                {
                    Panel panelBigImage = CreateImagePanel("Big image representation:", strBigImagePath);
                    _gridCanvas.Children.Add(panelBigImage);
                    int nColumnIndex = _gridCanvas.ColumnDefinitions.Count;
                    _gridCanvas.ColumnDefinitions.Add(new ColumnDefinition());
                    Grid.SetColumn(panelBigImage, nColumnIndex);
                }));
            }
        }
예제 #4
0
        private void LoadItemsWoker_DoWork(object sender, DoWorkEventArgs e)
        {
            //1st - Get from DB all data
            //Fetch this item data from DB
            ViewerTreeItemDescriptor selectedItem = Viewer.I.SelectedItem;

            _arrayDBValues = App.DB.GetAllDataOfAnItemFromMemory(selectedItem.PrimaryKeyValue, selectedItem.PrimaryKeyName, selectedItem.TableName);
            //2nd - Update the buttons states
            Dispatcher.Invoke(new Action(() =>
            {
                switch (_eDayTime)
                {
                case EDayTime.eMorning:
                    RadioButtonMorning.IsChecked = true;
                    break;

                case EDayTime.eDay:
                    RadioButtonDay.IsChecked = true;
                    break;

                case EDayTime.eDusk:
                    RadioButtonDusk.IsChecked = true;
                    break;

                case EDayTime.eNight:
                    RadioButtonNight.IsChecked = true;
                    break;
                }
                if (_bIsHighlighted)
                {
                    ButtonHighlighted.IsChecked = true;
                }
            }));
            //3rd - Display the information on canvas
            CreateUpdateMapsCanvas();
        }