Ejemplo n.º 1
0
    public override void Execute(INotice notice)
    {
        switch (notice.GetType())
        {
        case Command_Show:
            GameObject go   = null;
            GameObject root = GameObject.Find("UIRoot");
            go            = root.transform.Find("TabWindow").gameObject;
            this.mediator = RegisterMediator <TableMediator>(go);
            this.SendToMediator(notice);
            break;

        case Command_Close:
            RemoveMediator();
            break;

        case Command_Reactive:
            GameObject rego = null;     // must use a sync func to load the rego
            root          = GameObject.Find("UIRoot");
            rego          = root.transform.Find("TabWindow").gameObject;
            this.mediator = RegisterMediator <TableMediator>(rego);
            this.SendToMediator(notice);
            break;
        }
        base.Execute(notice);
    }
Ejemplo n.º 2
0
    public override void Execute(INotice notice)
    {
        switch (notice.GetType())
        {
        case Command_Show:
            LoadResource("CodeGenWindow", (go) => {
                RegisterMediator <CodeGenMediator>(go);
                this.SendToMediator(notice);
            });
            break;

        case Command_Close:
            RemoveMediator();
            break;

        case Command_Reactive:
            GameObject rego = SyncLoadResource("CodeGenWindow");     // must use a sync func to load the rego
            RegisterMediator <CodeGenMediator>(rego);
            this.SendToMediator(notice);
            break;

        case Command_OK:
            // TODO: the Mediator.OK() Logic

            break;

        case Command_Cancel:
            SelfNotice(Command_Close);
            break;
            // TODO: others custom notices...
        }
        base.Execute(notice);
    }
Ejemplo n.º 3
0
 public override void HandleNotice(INotice notice)
 {
     switch (notice.GetType())
     {
     case Command2.Command2_OK:
         this.view.input.text = notice.GetBody()[0].ToString();
         break;
     }
     base.HandleNotice(notice);
 }
Ejemplo n.º 4
0
 public override void HandleNotice(INotice notice)
 {
     switch (notice.GetType())
     {
     case Worker_Cloud.Broad_AddValue:
         this.view.num += (int)notice.GetBody()[0];
         break;
     }
     base.HandleNotice(notice);
 }
Ejemplo n.º 5
0
    public override void Execute(INotice notice)
    {
        switch (notice.GetType())
        {
        case Monitor_Closed:
            WindowStackManager.ins.OnWindowClosed(notice.GetBody()[0].ToString());
            break;
        }

        base.Execute(notice);
    }
Ejemplo n.º 6
0
 public override void Execute(INotice notice)
 {
     switch (notice.GetType())
     {
     case BroadCommand_Show:
         GameObject root = GameObject.Find("UIRoot");
         RegisterMediator <BroadMediator>(root.transform.Find("BroadWindow").gameObject);
         break;
     }
     base.Execute(notice);
 }
Ejemplo n.º 7
0
 public override void Execute(INotice notice)
 {
     switch (notice.GetType())
     {
     case Command.Command_Show:
         GameObject root = GameObject.Find("MapRoot");
         RegisterMediator <MapMediator>(root.gameObject);
         break;
     }
     base.Execute(notice);
 }
Ejemplo n.º 8
0
 public override void HandleNotice(INotice notice)
 {
     switch (notice.GetType())
     {
     case SubCommand.SubCommand_OK:
         this.view.text.text = notice.token.ToString();
         this._notice        = notice;
         break;
     }
     base.HandleNotice(notice);
 }
Ejemplo n.º 9
0
 public override void HandleNotice(INotice notice)
 {
     switch (notice.GetType())
     {
     case Command.Command_Show:
         OtherVo vo = notice.GetBody <OtherVo>();
         SetViewObj(vo);
         break;
     }
     base.HandleNotice(notice);
 }
Ejemplo n.º 10
0
        public Task PublishAsync(INotice notice, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (notice == null)
            {
                throw new ArgumentNullException(nameof(notice));
            }

            var noticeType = notice.GetType();

            var handler = _cache.GetOrAdd(noticeType,
                                          type => (InternalHandler)Activator.CreateInstance(typeof(InternalNoticeHandler <>).MakeGenericType(type)));

            return(handler.HandleAsync(notice, _serviceProvider, cancellationToken, PublishAsync));
        }
Ejemplo n.º 11
0
    public override void Execute(INotice notice)
    {
        switch (notice.GetType())
        {
        case Recv1Command_Show:
            GameObject root = GameObject.Find("UIRoot");
            RegisterMediator <RecvMediator>(root.transform.Find("Recv1Window").gameObject);
            break;

        case Worker_Cloud.Broad_AddValue:
            SendToMediator(notice);
            break;
        }
        base.Execute(notice);
    }
Ejemplo n.º 12
0
    public override void Execute(INotice notice)
    {
        switch (notice.GetType())
        {
        case Command_Show:
            GameObject root = GameObject.Find("UIRoot");
            RegisterMediator <PreBMediator>(root.transform.Find("PreBWindow").gameObject, true);
            break;

        case Command_Close:
            RemoveMediator();
            break;
        }
        base.Execute(notice);
    }
Ejemplo n.º 13
0
    public override void HandleNotice(INotice notice)
    {
        switch (notice.GetType())
        {
        case Command.Command_Show:
            TableVo vo = notice.GetBody <TableVo>();
            SetViewObj(vo);
            ShowSubPage(viewObj.index);
            break;

        case Command.Command_Reactive:
            LoadViewObj();
            break;
        }
        base.HandleNotice(notice);
    }
Ejemplo n.º 14
0
    public override void HandleNotice(INotice notice)
    {
        // TODO: handle all notices from command
        switch (notice.GetType())
        {
        case Command.Command_Show:
            CodeGenVo vo = notice.GetBody <CodeGenVo>();
            SetViewObj(vo);
            break;

        case Command.Command_Reactive:
            LoadViewObj();
            break;
            // TODO: others custom notices...
        }
        base.HandleNotice(notice);
    }
Ejemplo n.º 15
0
    public override void Execute(INotice notice)
    {
        switch (notice.GetType())
        {
        case Command_Show:
            GameObject root = GameObject.Find("UIRoot");
            RegisterMediator <AMainMediator>(root.transform.Find("MainWindow").gameObject);
            break;

        case Command_Close:
            RemoveMediator();
            break;

        case Command_Reactive:
            SendNotice(Index, Command_Show);
            break;
        }
        base.Execute(notice);
    }
Ejemplo n.º 16
0
    public override void HandleNotice(INotice notice)
    {
        switch (notice.GetType())
        {
        case Command.Command_Show:
            KeepVo vo = notice.GetBody <KeepVo>();
            if (vo == null)
            {
                vo = new KeepVo();
            }
            SetViewObj(vo);
            break;

        case Command.Command_Reactive:
            LoadViewObj();
            break;
        }
        base.HandleNotice(notice);
    }
Ejemplo n.º 17
0
    public override void Execute(INotice notice)
    {
        switch (notice.GetType())
        {
        case Command1_Show:
            GameObject root = GameObject.Find("UIRoot");
            RegisterMediator <Mediator1>(root.transform.Find("Canvas1").gameObject);
            break;

        case Command1_OK:
            Facade.ChangeScene("Scene1", (token) =>
            {
                this.SendNotice(Index, Command1_Show);
                this.SendToMediator(notice);
            });
            break;
        }
        base.Execute(notice);
    }
Ejemplo n.º 18
0
    public override void Execute(INotice notice)
    {
        switch (notice.GetType())
        {
        case SubCommand_Show:
            GameObject root = GameObject.Find("UIRoot");
            RegisterMediator <SubMediator>(root.transform.Find("SubWindow").gameObject);
            break;

        case SubCommand_Close:
            RemoveMediator();
            break;

        case SubCommand_OK:
            SendNotice(Index, SubCommand_Show);
            SendToMediator(notice);
            break;
        }
        base.Execute(notice);
    }
Ejemplo n.º 19
0
    public override void Execute(INotice notice)
    {
        switch (notice.GetType())
        {
        case Command_Show:
            GameObject root = GameObject.Find("UIRoot");
            RegisterMediator <ASubMediator>(root.transform.Find("SubWindow").gameObject);
            break;

        case Command_Close:
            RemoveMediator();
            break;

        case Command_OK:
            Facade.ChangeScene("ASubScene", (token) =>
            {
                SendNotice(Index, Command_Show);
                SendToMediator(notice);
            });
            break;
        }
        base.Execute(notice);
    }
Ejemplo n.º 20
0
    public override void Execute(INotice notice)
    {
        switch (notice.GetType())
        {
        case Command_Show:
            GameObject go   = null;
            GameObject root = GameObject.Find("UIRoot");
            go            = root.transform.Find("OtherWindow").gameObject;
            this.mediator = RegisterMediator <OtherMediator>(go);
            this.SendToMediator(notice);
            break;

        case Command_Close:
            RemoveMediator();
            break;

        case Command_OK:
            ChangeScene("OtherScene", (token) => {
                SelfNotice(Command_Show);
            });
            break;
        }
        base.Execute(notice);
    }