コード例 #1
0
        private void updateGamesListBox()
        {
            Program.allGames       = Program.fetcher.getActivationMods();
            Program.allGameWidgets = Program.fetcher.getModWidgetsAll();
            listViewGames.Clear();

            IEnumerator ienum = Program.allGames.Values.GetEnumerator();

            while (ienum.MoveNext())
            {
                ModInfoDb modInfo = (ModInfoDb)ienum.Current;

                ListViewItem item = new ListViewItem(modInfo.abbreviation);
                item.Tag = modInfo.id.ToString();

                if (!Program.isSuperAdmin && (modInfo.ownerId != Program.UserId))
                {
                    item.ForeColor = Color.LightGray;
                }

                listViewGames.Items.Add(item);
            }

            try
            {
                this.updateGameWidgetList(getSelectedGame());
            }
            catch (Exception)
            {
                this.updateGameWidgetList("");
            }
        }
コード例 #2
0
        private void buttonSaveOrderFilename_Click(object sender, EventArgs e)
        {
            try
            {
                String modShort      = this.textBoxGameShortname.Text;
                String orderFilename = this.textBoxOrderFilename.Text;

                Program.fetcher.updateMod(this.getSelectedGameId(), modShort, orderFilename);

                ModInfoDb modinfo = Program.allGames[this.getSelectedGame()];
                modinfo.abbreviation        = modShort;
                modinfo.configOrderFilename = orderFilename;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Exception occured: " + ex.Message);
            }
        }
コード例 #3
0
        private void updateGameWidgetList(String game)
        {
            listViewGameWidgetList.Clear();

            if ((game.Length == 0 || (Program.UserId != ((ModInfoDb)Program.allGames[game]).ownerId) && (Program.isSuperAdmin == false)))
            {
                this.toggleGameWidgetListDisplayElements(false);
                return;
            }

            toggleGameWidgetListDisplayElements(true);
            this.toggleGameWidgetInfoDisplayElements(false);

            Program.allGames       = Program.fetcher.getActivationMods();
            Program.allGameWidgets = Program.fetcher.getModWidgetsAll();

            ModInfoDb  minfo         = (ModInfoDb)Program.allGames[game];
            WidgetList modWidgetList = minfo.modWidgets;

            foreach (DictionaryEntry elem in modWidgetList)
            {
                WidgetInfo   winfo = (WidgetInfo)elem.Value;
                ListViewItem item  = new ListViewItem(winfo.headerName);
                item.Tag = winfo.id.ToString();

                listViewGameWidgetList.Items.Add(item);
            }
            try
            {
                this.updateGameWidgetInfo(getSelectedGameWidgetId());
            }
            catch (Exception)
            {
            }

            this.textBoxGameShortname.Text = minfo.abbreviation;
            this.textBoxOrderFilename.Text = minfo.configOrderFilename;
        }