Exemplo n.º 1
0
    private void AddContext()
    {
        string    strAddContext = uiWordDesc.GetContext();
        AddWordVO addWordVO     = new AddWordVO(curWordVO.Spell, strAddContext);

        SendNotification(EventEnum.COMMAND_ADD_WORD, addWordVO);
    }
Exemplo n.º 2
0
    public override void Execute(INotification notification)
    {
        AddWordVO addWordVO = notification.Body as AddWordVO;
        BookMgr   bookMgr   = Facade.RetrieveProxy(ProxyEnum.BOOK_MGR) as BookMgr;

        bookMgr.AddWord(addWordVO.BookName, addWordVO.Spell, addWordVO.Context);
        SendNotification(EventEnum.COMMAND_WORD_ADDED, addWordVO);
    }
Exemplo n.º 3
0
    public override void HandleNotification(INotification notification)
    {
        switch (notification.Name)
        {
        case EventEnum.COMMAND_WORD_ADDED:
        {
            AddWordVO addWordVO = notification.Body as AddWordVO;
            if (curWordVO != null && addWordVO.Spell == curWordVO.Spell)
            {
                ShowWorld(curWordVO.Spell);
                uiWordDesc.CleanSearchWord();
                uiWordDesc.CleanContext();
            }
        }
        break;

        default:
            base.HandleNotification(notification);
            break;
        }
    }