示例#1
0
 public void LoadSetting(XElement settingRoot)
 {
     timers.Clear();
     foreach (XElement element in settingRoot.Elements("Timer"))
     {
         IObjectEditorType type = provider.Types.Where(t => t.GetType().AssemblyQualifiedName == element.Attribute("Class").Value).FirstOrDefault();
         if (type != null)
         {
             ICalendarTimer timer = (ICalendarTimer)type.CreateObject();
             timer.LoadSetting(element);
             timers.Add(timer);
         }
     }
 }
 public void LoadSetting(XElement settingRoot)
 {
     commands.Clear();
     foreach (XElement element in settingRoot.Elements("ScriptingCommand"))
     {
         IObjectEditorType type = provider.Types.Where(t => t.GetType().AssemblyQualifiedName == element.Attribute("Class").Value).FirstOrDefault();
         if (type != null)
         {
             ScriptingCommand command = (ScriptingCommand)type.CreateObject();
             command.LoadSetting(element);
             commands.Add(command);
         }
     }
 }
示例#3
0
        private void item_Click(object sender, EventArgs e)
        {
            IObjectEditorType   type = (sender as ToolStripMenuItem).Tag as IObjectEditorType;
            IObjectEditorObject obj  = type.CreateObject();

            obj.Name = "未命名";
            provider.Objects.Add(obj);

            ListViewItem item = new ListViewItem(obj.Name);

            item.Tag = obj;
            listViewCommands.Items.Add(item);
            item.Selected = true;
        }