Exemple #1
0
        private void ShortcutButton_Click(object sender, EventArgs e)
        {
            int    nShortcutsCreated = 0;
            string gwArgs            = string.Empty;

            foreach (string gwPath in profilesListBox.SelectedItems)
            {
                gwArgs = mSettings.GetArguments(gwPath);

                if (ShortcutCreator.CreateSingleLaunchShortcut(gwPath, gwArgs))
                {
                    nShortcutsCreated++;
                }
            }

            MessageBox.Show(nShortcutsCreated.ToString() + " Desktop shortcuts were created!", "Info",
                            MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        private static int CreateShortcut(int[] selectedInstalls)
        {
            int    nShortcutsCreated = 0;
            string gwPath            = string.Empty;
            string gwArgs            = string.Empty;

            foreach (int index in selectedInstalls)
            {
                gwPath = Program.settings.GetPath(index);
                gwArgs = Program.settings.GetArguments(index);

                if (ShortcutCreator.CreateSingleLaunchShortcut(gwPath, gwArgs))
                {
                    nShortcutsCreated++;
                }
            }

            MessageBox.Show(nShortcutsCreated.ToString() + " Desktop shortcuts were created!", "Info",
                            MessageBoxButtons.OK, MessageBoxIcon.Information);

            return(nShortcutsCreated);
        }