Exemplo n.º 1
0
 public void Save(ManagedTreeItem mti)
 {
     MidiPlugin.log.Debug("Saving RuleSet {0}", Name);
     mti.setValue <string>("Name", this.Name);
     mti.setValue <string>("InputDeviceID", this.InputDeviceID);
     mti.setValue <string>("OutputDeviceID", this.OutputDeviceID);
     mti.setValue <string>("GUID", this.GUID);
     foreach (DeviceRule rule in this.Rules)
     {
         ManagedTreeItem mtir = new ManagedTreeItem("Rule");
         rule.Save(mtir);
         mti.AddChild(mtir);
     }
 }
Exemplo n.º 2
0
        private void Save()
        {
            log.Debug("Save called!");
            ManagedTreeItem _midi = new ManagedTreeItem("MidiSettings");

            foreach (RuleSet item in this.midi.RuleSets)
            {
                ManagedTreeItem rs = new ManagedTreeItem("RuleSet");
                item.Save(rs);
                _midi.AddChild(rs);
            }
            log.Debug("Creating resource");
            LumosResource res = new LumosResource(MidiPlugin.myMetaData.Name, _midi);

            log.Debug("Resource created: {0}", res.ManagedData.Children.Count);
            ResourceManager.getInstance().saveResource(EResourceType.PROJECT, res);


            log.Debug("Resource saved");
        }