public CreateTopologyControl(IKeyTableFactory tableFactory, IAsynchQueueFactory queueFactory, IPrimFactory primFactory, IModel model, IConfigSource config) : base(tableFactory, queueFactory, primFactory, model, config) { /* //Touch Button IButton floor = Factory.MakeButton("Floor", Permissions, HostPrim.ID); floor.OnTouched += (source, args) => AddRouter(args.AvatarName, args.AvatarID, args.TouchPosition); */ IConfig controlConfig = config.Configs["Control"]; string god = controlConfig.Get(GOD_KEY, GOD); string topologyDefault = controlConfig.Get(TOPOLOGY_KEY, GOD); _listener = (name, id, text, channel) => { string[] args = text.Split(' '); if (id.Equals(HostPrim.Owner) && args[0].ToUpper().Equals("SAVE")) { if (args.Length > 1) { HostPrim.Say("Saving topology as " + args[1]); Topology.SaveTopology(name, id, args[1]); } else { HostPrim.Say("Showing Dialog"); SaveDialog save = new SaveDialog(HostPrim, primFactory, "Topology", topologyDefault, user => Topology.GetUserFolder(god)); save.OnSave += (userName, userID, file) => Topology.SaveTopology(name, id, file); save.Show(name, id); } } }; primFactory.OnChat += _listener; }
public CreateSequenceControl(IKeyTableFactory tableFactory, IAsynchQueueFactory queueFactory, IPrimFactory primFactory, IModel model, IConfigSource config) : base(tableFactory, queueFactory, primFactory, model, config) { IConfig controlConfig = config.Configs["Control"]; string god = controlConfig.Get(GOD_KEY, GOD); string topology = controlConfig.Get(TOPOLOGY_KEY, null); string sequenceDefault = controlConfig.Get(SEQUENCE_KEY, SEQUENCE); if (topology != null) Topology.LoadTopology(god, Factory.Host.Owner, topology); _listener = (name, id, text, channel) => { string[] args = text.Split(' '); if (id.Equals(HostPrim.Owner) && args[0].ToUpper().Equals("SAVE")) { if (args.Length > 1) { HostPrim.Say("Saving sequence as " + args[1]); if (topology != null) Record.SaveRecording(god, args[1], topology); else Record.SaveRecording(god, args[1]); } else { HostPrim.Say("Showing Dialog"); SaveDialog save = new SaveDialog(HostPrim, primFactory, "Sequence", sequenceDefault, user => Record.GetUserFolder(god)); save.OnSave += (user, userID, file) => { if (topology == null) Record.SaveRecording(god, file); else Record.SaveRecording(god, file, topology); }; save.Show(name, id); } } }; primFactory.OnChat += _listener; Record.StartRecording(); }