Esempio n. 1
0
 private void btDelete_Click(object sender, EventArgs e)
 {
     if (listBoxMain.SelectedIndex != -1)
     {
         if (MessageBox.Show("Are you sure you want to delete this DelayStartup App", "Are You Sure", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
         {
             LinkMaster myDel = new LinkMaster();
             myDel.DeleteLink((LinkType)listBoxMain.SelectedItem);
         }
     }
     ListBoxMainRefresh();
 }
        private void btCreateStartUp_Click(object sender, EventArgs e)
        {
            if (appReady == true)
            {

                LinkMaster myLink = new LinkMaster();
                string lnkStartupPath = myLink.CreatLink(appName, appDelayTime, appLocationName);

                ////message Box
                //if (MessageBox.Show("The DelayTimer has been added, Would you like run the App", "Do you want to test Delaytimer", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                //{
                //    //if click yes Run app
                //    Process.Start(lnkStartupPath);
                //}
                ////close app
                this.Close();
            }
            else
            {
                //do nothing
            }
        }
Esempio n. 3
0
 private void ListBoxMainRefresh()
 {
     listBoxMain.Items.Clear();
     LinkMaster myLink = new LinkMaster();
     List<LinkType> listofLinks = new List<LinkType>();
     listofLinks = myLink.LoadLinksFromStartup();
     foreach (LinkType element in listofLinks)
     {
         listBoxMain.Items.Add(element);
     }
 }
Esempio n. 4
0
 private void btOpenStartupPath_Click(object sender, EventArgs e)
 {
     LinkMaster myLink = new LinkMaster();
     Process.Start(myLink.GetStartupPath());
 }