Beispiel #1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (txtAddCommand.Text != string.Empty)
     {
         PackagesManagement pm = new PackagesManagement();
         pm.add(new string[] { txtAddCommand.Text });
         RefreshList();
         txtAddCommand.Text = string.Empty;
     }
     else
     {
         MessageBox.Show(Translation.Engine.Lines["mboxnopackagenamegiventext"], Translation.Engine.Lines["mboxnopackagenamegiventitle"], MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Deletes all controls from panelListBoxContainer and than add a new checkbox for each
        /// package saved on the packages file
        /// </summary>
        private void RefreshList()
        {
            panelListBoxContainer.Controls.Clear();
            PackagesManagement pm = new PackagesManagement();
            var packages          = pm.load();

            foreach (var pack in packages)
            {
                MaterialCheckBox chkNew = new MaterialCheckBox();
                chkNew.Text = pack;
                FixChkSize(chkNew);
                AddCheckBox(chkNew);
            }
        }
Beispiel #3
0
 /// <summary>
 /// Remove the packages from the packages file and than refreshes the list
 /// </summary>
 private void RemoveSelected()
 {
     if (isAnyPackageSelected())
     {
         PackagesManagement pm = new PackagesManagement();
         GetCheckedBoxesText().ForEach((box) =>
         {
             pm.remove(box);
         });
         chkCheckAll.Checked = false;
         RefreshList();
     }
     else
     {
         noPackagesSelectedMsg();
     }
 }
Beispiel #4
0
        private void addInstalledToList()
        {
            string output = Cmd.RunAndWaitWithOutput("choco list --local-only", ProcessWindowStyle.Hidden);

            output.Split('\n').ToList().ForEach((line) =>
            {
                this.Invoke(new MethodInvoker(() =>
                {
                    if ((!line.Contains("installed")) && line != "")
                    {
                        PackagesManagement pm = new PackagesManagement();
                        pm.add(new string[] { line.Split(' ')[0] });
                        RefreshList();
                    }
                    HideLog();
                }));
            });
        }
Beispiel #5
0
 private void btnOpenSite_Click(object sender, EventArgs e)
 {
     if (Application.OpenForms["FrmBrowser"] == null)
     {
         FrmBrowser browser = new FrmBrowser();
         browser.Show();
         browser.FormClosed += (send, ev) =>
         {
             foreach (string package in browser.Chocolatras)
             {
                 PackagesManagement pm = new PackagesManagement();
                 pm.add(new string[] { package });
             }
             RefreshList();
         };
     }
     else
     {
         Application.OpenForms["FrmBrowser"].BringToFront();
     }
 }