public SystemExtension() { commands = new List <EnsoCommand>(commandActions.Count); foreach (KeyValuePair <String, CommandDesc> cmd in commandActions) { CommandDesc desc = cmd.Value; commands.Add(new EnsoCommand(cmd.Key, desc.postfix, desc.desc, desc.desc, desc.postfixType)); } }
public void Load(IEnsoService service) { Debug.Assert(service != null); this.service = service; String uri = this.GetType().Name + ".rem"; foreach (EnsoCommand command in commands) { service.RegisterCommand(this, uri, command); CommandDesc desc = commandActions[command.Name]; if (desc.getPostfixes != null) { service.SetCommandValidPostfixes(command, desc.getPostfixes()); } } }
public void OnCommand(EnsoCommand command, string postfix) { CommandDesc desc = commandActions[command.Name]; new Thread(() => desc.action(postfix, service)).Start(); }