Example #1
0
 private void CreatePakage_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (!Editing)
     {
         Pakage p = new Pakage()
         {
             Name        = NameBox.Text,
             DownloadURL = URLBox.Text,
             Description = DescriptionBox.Text.Replace("{n}", Environment.NewLine),
             JName       = JNameBox.Text,
             exe         = EXEBox.Text,
             args        = ArgsBox.Text,
             User        = UserBox.Text,
             Password    = PassBox.Password
         };
         Corelib.Pakages.Add(p);
     }
     else
     {
         Corelib.Current.Name        = NameBox.Text;
         Corelib.Current.DownloadURL = URLBox.Text;
         Corelib.Current.Description = DescriptionBox.Text.Replace("{n}", Environment.NewLine);
         Corelib.Current.JName       = JNameBox.Text;
         Corelib.Current.exe         = EXEBox.Text;
         Corelib.Current.args        = ArgsBox.Text;
         Corelib.Current.User        = UserBox.Text;
         Corelib.Current.User        = UserBox.Text;
         Corelib.Current.Password    = PassBox.Password;
     }
     Corelib.ExportList();
 }
Example #2
0
        private void ExportBtn_Click(object sender, EventArgs e)
        {
            Pakage p = new Pakage();

            p.Name = textBoxName.Text;

            p.Description = textBoxDescription.Text;
            p.Description = p.Description.Replace("{n}", Environment.NewLine);

            p.DownloadURL = textBoxURL.Text;

            p.exe = textBoxExe.Text;

            p.JName = textBoxJName.Text;

            p.args = textBoxArgs.Text;

            p.Password = textBoxPassword.Text;

            p.User = textBoxUser.Text;

            Program.Pakages.Add(p);
            Corelib lib = new Corelib();

            lib.ExportList(Program.Pakages);
            Program.Import();
            Close();
        }
Example #3
0
        private void wc_DownloadFinished(object sender, EventArgs e)
        {
            Corelib lib = new Corelib();

            lib.Write("Download done" + Program.Downloading.Name);
            Invoke(new Action(setIsInstalled));
            Program.Downloading.Install();
            Invoke(new Action(SetIsInstalled));
            lib.ExportList(Program.Pakages);
            InUse = false;
        }
Example #4
0
        private void ButtonPanel_Drop(object sender, DragEventArgs e)
        {
            string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
            foreach (string f in files)
            {
                switch (Path.GetExtension(f))
                {
                case ".json":
                    Corelib.ImportF(f);
                    AddButtons();
                    break;

                case ".zip":
                    string folder = Corelib.DownloadsFolder + Path.GetFileName(f);
                    ZipFile.ExtractToDirectory(f, folder);
                    foreach (string s in Directory.GetFiles(folder, "*.json"))
                    {
                        try
                        {
                            Corelib.ImportF(s);
                            AddButtons();
                        }
                        catch (IOException ex)
                        {
                            Corelib.Write(ex.ToString());
                        }
                    }
                    Corelib.ClearDownloadsFolder();
                    break;
                }
            }
            Corelib.ExportList();
            Notify.Show(new NotificationContent
            {
                Title = "Import Finished",
                Type  = NotificationType.Success
            });
        }
Example #5
0
 public static void Export() => Lib.ExportList(Pakages);
Example #6
0
 private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     Corelib.ExportList();
 }
Example #7
0
 private void Export_Button_Click(object sender, RoutedEventArgs e)
 {
     Corelib.ExportList();
 }