private void LoadFromFile(string filePath)
        {
            using (StreamReader sr = new StreamReader(filePath))
            {
                String line;

                line = sr.ReadLine();
                labelRealPath.Content = line;

                line = sr.ReadLine();
                labelRealLabelsPath.Content = line;

                line = sr.ReadLine();
                labelRealOutputFolder.Content = line;

                loadedConfig = true;
                HandleAllPaths();
                loadedConfig = false;

                zCFGList = new List <ZillaConfig>();
                listBoxCurrentConfig.Items.Clear();

                while ((line = sr.ReadLine()) != null)
                {
                    string[] tokLine = new string[5];

                    ZillaConfig zCFG = LoadZillaConfig(tokLine = line.Split('~'));

                    PopulateListBox(zCFG);
                }
            }
        }
        private void PopulateListBox(ZillaConfig zCFG)
        {
            listBoxCurrentConfig.Items.Add("Map " + zCFG.ComboBoxString + " to " +
                                           zCFG.FolderName + " for " + zCFG.Amount + " elements");

            zCFGList.Add(zCFG);
        }
 private void EditZillaConfig(ZillaConfig zCFG, int index)
 {
     zCFGList[index].Amount         = zCFG.Amount;
     zCFGList[index].AmountDummy    = zCFG.AmountDummy;
     zCFGList[index].ComboBoxIndex  = zCFG.ComboBoxIndex;
     zCFGList[index].ComboBoxString = zCFG.ComboBoxString;
     zCFGList[index].FolderName     = zCFG.FolderName;
 }
        private ZillaConfig LoadZillaConfig(string[] tokLine)
        {
            ZillaConfig zCFG = new ZillaConfig(tokLine[0],
                                               int.Parse(tokLine[1]),
                                               tokLine[2],
                                               int.Parse(tokLine[3]),
                                               int.Parse(tokLine[4]));

            return(zCFG);
        }
示例#5
0
        //
        // THIS WINDOW IS NOT IN USE ANYMORE
        //

        private void buttonSubmitConfig_Click(object sender, RoutedEventArgs e)
        {
            ZillaConfig zCFG = new ZillaConfig(textBoxFolderName.Text,
                                               comboBoxMapFrom.SelectedIndex,
                                               comboBoxMapFrom.Text,
                                               int.Parse(textBoxNumberOfFiles.Text),
                                               0);

            ((MainWindow)Application.Current.MainWindow).listBoxCurrentConfig.Items.Add("Map " + zCFG.ComboBoxString + " to " + zCFG.FolderName + " for " + zCFG.Amount + " elements");

            //((MainWindow)Application.Current.MainWindow).zCFGList.Add(zCFG);

            this.Close();
        }
        private ZillaConfig CreateZillaConfig()
        {
            try
            {
                if (textBoxFolderName.Text == "")
                {
                    MessageBox.Show("Name the folder to which you mant to map to. SortZilla can't guess what you want :(.");
                }

                else if (comboBoxMapFrom.SelectedIndex < 0)
                {
                    MessageBox.Show("Select category from where to map from. Don't confuse SortZilla :(.");
                }

                else if (int.Parse(textBoxNumberOfFiles.Text) == 0 || int.Parse(textBoxNumberOfFiles.Text) < -1)
                {
                    MessageBox.Show("Enter -1 if you want SortZilla to process all files. Other negative or non-zero numbers are not accepted.");
                }

                else
                {
                    ZillaConfig zCFG;

                    zCFG = new ZillaConfig(textBoxFolderName.Text,
                                           comboBoxMapFrom.SelectedIndex,
                                           comboBoxMapFrom.Text,
                                           int.Parse(textBoxNumberOfFiles.Text),
                                           0);

                    return(zCFG);
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }

            return(null);
        }
 private void UpdateListBox(ZillaConfig zCFG, int index)
 {
     listBoxCurrentConfig.Items[index] = "Map " + zCFG.ComboBoxString + " to " +
                                         zCFG.FolderName + " for " + zCFG.Amount + " elements";
 }