public void AddPerfil()
        {
            dynamic form = Activator.CreateInstance(UsbMode.FindType("DisplayButtons.Forms.PerfilEditor")) as Form;

            if (form.ShowDialog() == DialogResult.OK)
            {
                Profile teste = new Profile();
                teste.Name       = form.textBox1.Text;
                teste.Mainfolder = new DynamicDeckFolder();
                //  teste.Currentfolder = teste.Mainfolder;
                if (DevicePersistManager.PersistedDevices.Count == 0)
                {
                    foreach (var device_con in DevicePersistManager.DeckDevicesFromConnection)
                    {
                        device_con.Value.profiles.Add(teste);
                    }
                }
                else
                {
                    foreach (var device in DevicePersistManager.PersistedDevices.ToList())
                    {
                        device.profiles.Add(teste);
                    }
                }
                MainForm.Instance.FillPerfil();
            }
            else
            {
                form.Close();
            }
        }
Esempio n. 2
0
        private void ModernButton11_Click(object sender, EventArgs e)
        {
            var     keyInfo = new KeyInfoAppSettingsGlobal(ApplicationSettingsManager.Settings.keyMainFolder.ModifierKeys, ApplicationSettingsManager.Settings.keyMainFolder.Keys);
            dynamic form    = Activator.CreateInstance(UsbMode.FindType("DisplayButtons.Forms.ActionHelperForms.MagnetiteControlsSelector")) as Form;

            var execAction = new AppSettings() as AppSettings;

            execAction.keyMainFolder = ApplicationSettingsManager.Settings.keyMainFolder;
            form.mode             = 0;
            form.ModifiableAction = execAction;

            if (form.ShowDialog() == DialogResult.OK)
            {
                ApplicationSettingsManager.Settings.keyMainFolder = form.ModifiableAction.keyMainFolder;
            }
            else
            {
                ApplicationSettingsManager.Settings.keyMainFolder = keyInfo;
            }
        }
Esempio n. 3
0
        //type = 0 is trigger
        // type = 1 is action
        public void ToExecuteFormGeneral(int type)
        {
            dynamic form = Activator.CreateInstance(UsbMode.FindType("DisplayButtons.Forms.EventSystem.EventCreateNew")) as Form;

            form.FillComboBox(type);
            if (form.ShowDialog() == DialogResult.OK)
            {
                if (type == 0)
                {
                    form.global_panelControl.SaveConfig();
                    new FactoryForms().SaveButtonTrigger(form.global_panelControl.getClassImplementTrigger);
                }
                if (type == 1)
                {
                    form.global_panelControl.SaveConfig();
                    new FactoryForms().SaveButtonAction(form.global_panelControl.getClassImplementAction);
                }
            }
            else
            {
                form.Close();
            }
        }