Esempio n. 1
0
        public void populateListView()
        {
            Main_NEW main = new Main_NEW();

            main.localEpisodes.localEpisodesListview.Items.Clear();
            ListViewItem  lvi   = new ListViewItem();
            DirectoryInfo dinfo = new DirectoryInfo(Main_NEW.smbxWorldsDir);

            try
            {
                foreach (var d in dinfo.GetDirectories())
                {
                    lvi      = new ListViewItem();
                    lvi.Text = d.ToString();
                    main.localEpisodes.localEpisodesListview.Items.Add(lvi);
                }
            }
            catch (DirectoryNotFoundException dx)
            {
                main.localEpisodes.localEpisodesListview.Items.Clear();
                MessageBox.Show("Directory not found: " + Main_NEW.smbxWorldsDir + "\nPlease configure the proper SMBX Directories\n\n" + dx.Message,
                                "Error!",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
        private void UpdateEpisode_Load(object sender, EventArgs e)
        {
            Control.CheckForIllegalCrossThreadCalls = false;
            Main_NEW mf = new Main_NEW();

            updatingToLabel.Text        = "Updating to Version " + Main_NEW.availVer;
            iconPicture.BackgroundImage = Main_NEW.bgImage;

            try
            {
                using (StreamReader sr = new StreamReader(Environment.CurrentDirectory + @"\temp\Update\changes.index"))
                {
                    string       line;
                    ListViewItem lvi = new ListViewItem();
                    while ((line = sr.ReadLine()) != null)
                    {
                        if (line.Contains("changedFiles"))
                        {
                            var      split     = line.Split(new char[] { '=' }, 2);
                            string[] fileslist = split[1].Split(',');
                            foreach (var item in fileslist)
                            {
                                if (item != "")
                                {
                                    lvi      = new ListViewItem();
                                    lvi.Text = item.ToString();
                                    if (item.Contains(".lvl"))
                                    {
                                        lvi.SubItems.Add("Level File");
                                    }
                                    else if (item.Contains(".gif"))
                                    {
                                        lvi.SubItems.Add("Custom Graphic");
                                    }
                                    else if (item.Contains(".wld"))
                                    {
                                        lvi.SubItems.Add("World File");
                                    }
                                    else if (item.Contains(".mp3"))
                                    {
                                        lvi.SubItems.Add("MP3 Music File");
                                    }
                                    else if (item.Contains(".wav"))
                                    {
                                        lvi.SubItems.Add("WAV Music File");
                                    }
                                    else if (item.Contains(".txt"))
                                    {
                                        lvi.SubItems.Add("NPC Code File");
                                    }
                                    lvi.SubItems.Add("Queued");
                                    changesListView.Items.Add(lvi);
                                }
                            }
                        }
                    }
                }
            }
            catch (FileNotFoundException fnex)
            {
                MessageBox.Show("The changes file could not be loaded\n" + fnex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
 public LoadingIndex(string episodeToDelete, Main_NEW _Main_NEW)
 {
     mf         = _Main_NEW;
     epToDelete = episodeToDelete;
     InitializeComponent();
 }
Esempio n. 4
0
 public SettingsForm(Main_NEW _Main_NEW)
 {
     mf = _Main_NEW;
     InitializeComponent();
 }
 public AvailableEpisodesControl(Main_NEW _Main_NEW)
 {
     mf = _Main_NEW;
     InitializeComponent();
 }
Esempio n. 6
0
 public LoadingIndexDialog(Main_NEW _Main_NEW)
 {
     mf = _Main_NEW;
     InitializeComponent();
 }