Beispiel #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Text = "50PSAM";
            ga   = new GetApps();
            listBoxApps.Items.AddRange(ga.GetAppsArray());
            ga.ApplicationChanges += Ga_ApplicationChanges;

            timer1.Interval        = settings.RefreshTimerInterval;
            timer2.Interval        = settings.RefreshTimer2Interval * 1000;
            timer1.Enabled         = true;
            timer2.Enabled         = settings.AutoRefresh;
            tlSpustit.Enabled      = false;
            tlUninstall.Enabled    = false;
            tlUninstallAll.Enabled = (ga.appsCount == 0) ? false : true;
            hideOnClose            = settings.HideOnClosing;
            tlRefresh.Enabled      = !settings.AutoRefresh;

            for (int index = 0; index < ga.appsCount; index++)
            {
                ToolStripItem item = new ToolStripMenuItem();
                item.Name   = $"item{ga.Apps(index)}";
                item.Text   = $"Spustit {ga.Apps(index)}";
                item.Click += Item_Click;
                contextMenuStrip1.Items.Add(item);
            }
        }
Beispiel #2
0
 private void Item_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < ga.appsCount; i++)
     {
         if (ga.Apps(i) == sender.ToString().Substring("Spustit ".Length))
         {
             ga.StartApp(i);
         }
     }
 }