Ejemplo n.º 1
0
 private void button61_Click(object sender, EventArgs e)
 {
     if (listDesktopItems.SelectedItems.Count == 1)
     {
         Integrator.RemoveItem(listDesktopItems.SelectedItem.ToString());
         GetDesktopItems();
     }
 }
Ejemplo n.º 2
0
 private void button26_Click(object sender, EventArgs e)
 {
     if (listCustomCommands.SelectedItems.Count == 1)
     {
         Integrator.DeleteCustomCommand(listCustomCommands.SelectedItem.ToString());
         GetCustomCommands();
     }
 }
Ejemplo n.º 3
0
        private void GetCustomCommands()
        {
            customCommands = Integrator.GetCustomCommands();
            listCustomCommands.Items.Clear();

            foreach (string s in customCommands)
            {
                listCustomCommands.Items.Add(s);
            }
        }
Ejemplo n.º 4
0
        private void DefineCommandIconDialog_FileOk(object sender, CancelEventArgs e)
        {
            icontoadd.Text = DefineCommandIconDialog.FileName;

            if (icontoadd.Text.Contains(".exe"))
            {
                string iconpath = Integrator.ExtractIconFromExecutable(itemname.Text, DefineCommandIconDialog.FileName);
                icontoadd.Text = iconpath;
            }
        }
Ejemplo n.º 5
0
        private void button50_Click(object sender, EventArgs e)
        {
            if ((runfile.Text != string.Empty) && (runkey.Text != string.Empty))
            {
                Integrator.CreateCustomCommand(runfile.Text, runkey.Text);

                runfile.Clear();
                runkey.Clear();

                GetCustomCommands();
            }
        }
Ejemplo n.º 6
0
        internal void RemoveAllDesktopItems()
        {
            List <string> collection = new List <string>();

            foreach (string item in listDesktopItems.Items)
            {
                collection.Add(item);
            }

            Integrator.RemoveAllItems(collection);

            GetDesktopItems();
        }
Ejemplo n.º 7
0
        private void GetDesktopItems()
        {
            synapses = Integrator.GetDesktopItems();
            listDesktopItems.Items.Clear();

            for (int i = 0; i < synapses.Count; i++)
            {
                if (!string.IsNullOrEmpty(synapses[i]))
                {
                    listDesktopItems.Items.Add(synapses[i]);
                }
            }
        }
Ejemplo n.º 8
0
 private void button65_Click(object sender, EventArgs e)
 {
     Integrator.TakeOwnership(true);
 }
Ejemplo n.º 9
0
        private void addmodifybtn_Click(object sender, EventArgs e)
        {
            switch (SynapseSelectedType)
            {
            case DesktopItemType.Program:
                string program = itemtoadd.Text;
                string icon    = "";

                if (defaulticon.Checked)
                {
                    icon = program;
                }
                else
                {
                    icon = icontoadd.Text;
                }

                bool   shift = shiftkey.Checked;
                string nick  = itemname.Text;

                Integrator.AddItem(nick, program, icon, SynapseSelectedPosition, shift, DesktopItemType.Program);
                GetDesktopItems();
                SynapseReset();
                break;

            case DesktopItemType.Folder:
                string folder = itemtoadd.Text;
                string icon2  = "";

                if (defaulticon.Checked)
                {
                    icon2 = Integrator.FolderDefaultIcon;
                }
                else
                {
                    icon2 = icontoadd.Text;
                }

                bool   shift2 = shiftkey.Checked;
                string nick2  = itemname.Text;

                Integrator.AddItem(nick2, folder, icon2, SynapseSelectedPosition, shift2, DesktopItemType.Folder);
                GetDesktopItems();
                SynapseReset();
                break;

            case DesktopItemType.Link:
                string link  = itemtoadd.Text;
                string icon3 = "";
                string nick3 = itemname.Text;

                if (defaulticon.Checked)
                {
                    icon3 = Integrator.DownloadFavicon(link, nick3);
                }
                else
                {
                    icon3 = icontoadd.Text;
                }

                bool shift3 = shiftkey.Checked;

                Integrator.AddItem(nick3, link, icon3, SynapseSelectedPosition, shift3, DesktopItemType.Link);
                GetDesktopItems();
                SynapseReset();
                break;

            case DesktopItemType.File:
                string file  = itemtoadd.Text;
                string icon4 = "";
                string nick4 = itemname.Text;

                if (defaulticon.Checked)
                {
                    icon4 = "";
                }
                else
                {
                    icon4 = icontoadd.Text;
                }

                bool shift4 = shiftkey.Checked;

                Integrator.AddItem(nick4, file, icon4, SynapseSelectedPosition, shift4, DesktopItemType.File);
                GetDesktopItems();
                SynapseReset();
                break;

            case DesktopItemType.Command:
                string cmd   = itemtoadd.Text;
                string icon5 = "";
                string nick5 = itemname.Text;

                if (defaulticon.Checked)
                {
                    icon5 = "";
                }
                else
                {
                    icon5 = icontoadd.Text;
                }

                bool shift5 = shiftkey.Checked;

                Integrator.AddItem(nick5, cmd, icon5, SynapseSelectedPosition, shift5, DesktopItemType.Command);
                GetDesktopItems();
                SynapseReset();
                break;
            }
        }