public void AddScene(Scene s) { if (Scenes == null) { Scenes = new List<Scene>(); } Scenes.Add(s); }
// 显示当前场景. private void ShowScene(Scene s) { _initializing = true; ResetSceneZone(); _selected_scene = s; _pre_selected_zone = -1; _selected_zone = null; cl_zone.SelectedIndex = -1; for (int i = 0; i < cl_zone.Items.Count; i++) { cl_zone.SetItemChecked(i, false); } if (s != null && s.Zones != null) foreach (SceneZone sz in s.Zones) { cl_zone.SetItemChecked(sz.Index, sz.Enabled); } _initializing = false; }
private void lb_scenes_SelectedIndexChanged(object sender, EventArgs e) { if (lb_scenes.SelectedIndex >= 0) { _selected_scene = (Scene)lb_scenes.SelectedItem; ShowScene(_selected_scene); } else { ShowScene(null); } }
internal void RemoveScene(Scene s) { Scenes.Remove(s); }
public static Scene Default() { Scene s = new Scene() { Zones = new List<SceneZone>(), Name = string.Format("场景") }; return s; }