Esempio n. 1
0
        public KChart(SaveFile sav)
        {
            SAV = sav;
            alolanOnly = SAV.Generation == 7 && DialogResult.Yes == WinFormsUtil.Prompt(MessageBoxButtons.YesNo, "Alolan Dex only?");
            InitializeComponent();

            Array.Resize(ref species, SAV.Personal.TableLength);

            var AltForms = SAV.Personal.GetFormList(species, SAV.MaxSpeciesID);
            species = SAV.Personal.GetPersonalEntryList(AltForms, species, SAV.MaxSpeciesID, out baseForm, out formVal);

            DGV.Rows.Clear();
            for (int i = 1; i < species.Length; i++)
                PopEntry(i);

            DGV.Sort(DGV.Columns[0], ListSortDirection.Ascending);
        }
Esempio n. 2
0
        public KChart()
        {
            InitializeComponent();

            Array.Resize(ref species, Main.SAV.Personal.TableLength);

            var AltForms = Main.SAV.Personal.getFormList(species, Main.SAV.MaxSpeciesID);

            species = Main.SAV.Personal.getPersonalEntryList(AltForms, species, Main.SAV.MaxSpeciesID, out baseForm, out formVal);

            DGV.Rows.Clear();
            for (int i = 1; i < species.Length; i++)
            {
                popEntry(i);
            }

            DGV.Sort(DGV.Columns[0], ListSortDirection.Ascending);
        }
Esempio n. 3
0
        public KChart(SaveFile sav)
        {
            InitializeComponent();
            Icon = Properties.Resources.Icon;
            WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
            SAV = sav;

            Array.Resize(ref species, SAV.Personal.TableLength);

            var AltForms = SAV.Personal.GetFormList(species, SAV.MaxSpeciesID);

            species = SAV.Personal.GetPersonalEntryList(AltForms, species, SAV.MaxSpeciesID, out baseForm, out formVal);

            DGV.Rows.Clear();
            for (int i = 1; i < species.Length; i++)
            {
                PopEntry(i);
            }

            DGV.DoubleBuffered(true);

            DGV.Sort(DGV.Columns[0], ListSortDirection.Ascending);
        }
Esempio n. 4
0
        public void FillDGV()
        {
            string             sortByString = "";
            DataGridViewColumn sortBy       = new DataGridViewColumn();
            ListSortDirection  sortOrder    = ListSortDirection.Ascending;
            bool sort = false;

            try
            {
                sortByString = DGV.SortedColumn.HeaderText;

                if (DGV.SortOrder == SortOrder.Ascending)
                {
                    sortOrder = ListSortDirection.Ascending;
                }
                if (DGV.SortOrder == SortOrder.Descending)
                {
                    sortOrder = ListSortDirection.Descending;
                }

                sort = true;
            }
            catch { }

            DGV.DataSource = null;

            SQLiteCommand selectCmd = new SQLiteCommand("SELECT * FROM " + tableString, con);

            con.Open();

            SQLiteDataAdapter da    = new SQLiteDataAdapter(selectCmd);
            DataTable         table = new DataTable();

            da.Fill(table);

            con.Close();

            table.Columns.Add("Image", typeof(Image));
            table.Columns["Image"].SetOrdinal(0);

            string imageTitle;

            for (int index = 0; index < table.Rows.Count; index++)
            {
                imageTitle = table.Rows[index]["ImageTitle"].ToString();
                try { table.Rows[index]["Image"] = Image.FromFile(@"img\" + imageTitle + ".png"); } catch { }
            }

            DGV.DataSource = table;

            DGV.Columns[0].Width = 50;
            ((DataGridViewImageColumn)DGV.Columns[0]).ImageLayout = DataGridViewImageCellLayout.Zoom;

            DGV.Columns["Id"].Visible         = false;
            DGV.Columns["ImageTitle"].Visible = false;

            if (sort)
            {
                sortBy = new DataGridViewColumn();
                for (int index = 0; index < DGV.Columns.Count; index++)
                {
                    if (DGV.Columns[index].HeaderText == sortByString)
                    {
                        sortBy = DGV.Columns[index];
                        break;
                    }
                }

                DGV.Sort(sortBy, sortOrder);
            }
        }