Exemplo n.º 1
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            XElement title   = new XElement("title", NameInput.Text);
            XElement path    = new XElement("path", "(command)");
            XElement enabled = new XElement("run", "True");

            XElement commands = new XElement("commands");

            foreach (string command in CommandList.Items)
            {
                if (command != "")
                {
                    commands.Add(new XElement("command", command));
                }
            }

            XElement action = new XElement("action", title, path, enabled, commands);

            action.SetAttributeValue("type", "command");
            action.SetAttributeValue("id", SaveData.generateId());

            SaveData.data.Root.Add(action);
            SaveData.saveData();

            manager.reloadList();

            Hide();
        }
Exemplo n.º 2
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            XElement title   = new XElement("title", NameInput.Text);
            XElement path    = new XElement("path", PathInput.Text);
            XElement enabled = new XElement("run", "True");

            XElement action = new XElement("action", title, path, enabled);

            action.SetAttributeValue("type", "program");
            action.SetAttributeValue("id", SaveData.generateId());

            SaveData.data.Root.Add(action);
            SaveData.saveData();

            manager.reloadList();

            Hide();
        }