예제 #1
0
        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));
            }
        }
예제 #2
0
        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());
                }
            }
        }
예제 #3
0
        public void OnCommand(EnsoCommand command, string postfix)
        {
            CommandDesc desc = commandActions[command.Name];

            new Thread(() => desc.action(postfix, service)).Start();
        }