Exemple #1
0
        public void button_openPath()
        {
            popup.displayBlock("Loading file ...");
            OpenPath op   = new OpenPath();
            string   path = op.open();

            if (path != "")
            {
                label_pathOpen.Content = path;
                files = new LoadFiles();
                files.load(label_pathOpen.Content.ToString());
                editFiles      = new EditFiles();
                editFiles.main = files.main;
                editFiles.startEdit();
                files.copy();
                list_name_main.ItemsSource = files.mainCopy;
                list_name_main.Items.Refresh();
                //подготовим комбобоксы взяв инфу из настроек
                List <string> cbeVersionList = new List <string>()
                {
                    "01", "02", "03", "04", "05", "06", "07", "09", "10"
                };
                ComboBoxElements cbeVersion = new ComboBoxElements()
                {
                    bindComboSearch = cbeVersionList
                };
                comboBox_name_version.DataContext = cbeVersion;

                List <string> cbeCategoryList = new List <string>();
                cbeCategoryList.Add("");
                foreach (DataSettings ds in settings.editSettings.setElementsListView.data)
                {
                    cbeCategoryList.Add(ds.name);
                }
                ComboBoxElements cbeCategory = new ComboBoxElements()
                {
                    bindComboSearch = cbeCategoryList
                };
                comboBox_name_category.DataContext = cbeCategory;

                //комбо для поиска
                List <string> cbeSList = new List <string>()
                {
                    "Artist", "Title", "Album", "Genre", "Album Artist", "Year"
                };
                ComboBoxElements cbeS = new ComboBoxElements()
                {
                    bindComboSearch = cbeSList
                };
                comboBox_name_search.DataContext = cbeS;
            }
            popup.displayNan();
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {// изменить файл
            string path        = richTextBox1.SelectedText;
            string correctpath = "";

            for (int i = 0; i < path.Length - 1; i++)
            {
                correctpath += path[i];
            }

            string[] file = fm.GetThisFile(current, correctpath);



            // если мы редактируем погоду - то нам на заднем фоне бы поиметь карту.
            // поэтому, мы посмотрим - если это погода, то попросим еще и карту.
            string[] backgroudmap = null;
            if (correctpath.Contains("weather"))
            {
                // значит всетаки файлик погоды редактируем.

                // в этой же папке лежит файлик карты. с именем map.txt ее загрузим как фон
                string map    = "";
                int    maxpos = correctpath.Length - 1;

                while (correctpath[maxpos] != '\\')
                {
                    maxpos--;
                }

                for (int i = 0; i < maxpos + 1; i++)
                {
                    map += correctpath[i];
                }
                map += "map.txt";

                backgroudmap = fm.GetThisFile(current, map);
            }

            EditFiles editor = new EditFiles();

            editor.setUser          = current;
            editor.Buffer           = file;
            editor.SetBackgroundMap = backgroudmap;


            editor.WinFormsEdit();

            file = editor.Buffer;// теперь новое значение

            fm.SaveThisFile(current, correctpath, file);
        }
Exemple #3
0
 public void button_refresh()
 {
     popup.displayBlock("Refresh ...");
     files = new LoadFiles();
     files.load(label_pathOpen.Content.ToString());
     editFiles      = new EditFiles();
     editFiles.main = files.main;
     editFiles.startEdit();
     files.copy();
     list_name_main.ItemsSource = files.mainCopy;
     list_name_main.Items.Refresh();
     popup.displayNan();
 }
Exemple #4
0
 public void DeleteLinesTest()
 {
     Assert.AreEqual("OK", EditFiles.DeleteLines(Environment.CurrentDirectory + "/Test.txt", 2, 4));
 }