Exemplo n.º 1
0
 public void CloseScene(int removeCount = 1, bool isBack = false)
 {
     if (scene != null)
     {
         s.RemoveChild(scene.group, true);
         scene = null;
         int index = removeCount;
         if (isBack)
         {
             index = scenes.Count - removeCount;
         }
         while (index > 0)
         {
             if (scenes.Count == 0)
             {
                 break;
             }
             scenes.RemoveAt(scenes.Count - 1);
             --index;
         }
     }
     if (scenes.Count != 0)
     {
         Type         type = scenes [scenes.Count - 1];
         BaseMediator view = Activator.CreateInstance(type) as BaseMediator;
         scene = view;
         s.AddChild(view.group);
     }
 }
Exemplo n.º 2
0
    public BaseMediator ShowView <T> (bool isEffect = true, bool ifMask = true)
    {
        BaseMediator view = Activator.CreateInstance <T> () as BaseMediator;

        views.Add(view);
        v.AddChild(view.group);
        SetMask();
        if (!ifMask)
        {
            mask.alpha = 0;
        }
        else
        {
            mask.alpha = 1;
        }

        if (isEffect)
        {
            GRoot.inst.touchable = false;
            EffectManager.inst.ShowView(view.group, () =>
            {
                GRoot.inst.touchable = true;
                view.group.InvalidateBatchingState();
            });
        }
        return(view);
    }
Exemplo n.º 3
0
    public void ShowScene <T> (bool isRemove = false)
    {
        if (sceneMask == null)
        {
            sceneMask = Tools.GetComponent(Config.COM_SCENEMASK).asCom;
            s.AddChild(sceneMask);
            ViewManager.SetWidthHeight(sceneMask);
        }
        scenes.Add(typeof(T));
        if (isRemove)
        {
            if (scenes.Count != 0)
            {
                scenes.RemoveAt(scenes.Count - 1);
            }
        }
        if (scene != null)
        {
            s.RemoveChild(scene.group, true);
            scene = null;
        }
        this.ClearViews();

        BaseMediator view = Activator.CreateInstance <T> () as BaseMediator;

        scene = view;
        s.AddChild(view.group);
        EffectManager.inst.TweenAlpha(view.group, 0.3f, 0.5f, 1f);
    }
Exemplo n.º 4
0
    public void CloseView(BaseMediator view = null)
    {
//		s.visible = true;
        if (views.Count == 0)
        {
            return;
        }
        BaseMediator b;

        if (view == null)
        {
            b = views [views.Count - 1];
            views.RemoveAt(views.Count - 1);
            v.RemoveChild(b.group, true);
        }
        else
        {
            for (int i = 0; i < views.Count; i++)
            {
                if (views [i] == view)
                {
                    b = view;
                    views.RemoveAt(i);
                    v.RemoveChild(b.group, true);
                    break;
                }
            }
        }
        SetMask();
    }
Exemplo n.º 5
0
        /************************************************Unity方法与事件***********************************************/

        /************************************************自 定 义 方 法************************************************/
        //注册输入监听
        public override void OnRegister()
        {
            this.View = TopViewHelper.ETopView.eDownloadPage2;
            base.OnRegister();
            this.DownloadPageView.StopSignal.AddListener(this.OnStopDownload);
            BaseMediator.LockKeysIgnore(new List <MainKeys>()
            {
                MainKeys.PowerClick
            });
        }
Exemplo n.º 6
0
 private void AddChildView(BaseMediator child)
 {
     if (childView != null)
     {
         this.RemoveChild(childView.group, true);
         childView = null;
     }
     childView = child;
     this.AddChild(childView.group);
     childView.group.x = n0.x;
     childView.group.y = n0.y;
 }
        public async Task DeleteProductType_ValidRequest_SuccessResult()
        {
            var id = Guid.NewGuid();

            //Arrange
            BaseMediator.Setup(x => x.Send(It.IsAny <DeleteProductTypeCommand>(), new CancellationToken())).
            ReturnsAsync(true);
            var productTypesController = new ProductTypesController(BaseMediator.Object);

            //Action
            var result = await productTypesController.Delete(id);

            //Assert
            Assert.True(result.Value);
        }
Exemplo n.º 8
0
    public void Show(BaseMediator view)
    {
        p = view;
        string[] names = curCheck.Split(':');
        int      g1    = Convert.ToInt32(names [0]);
        int      g2    = Convert.ToInt32(names [1]);

        if (this.guide11 == g1 && this.guide12 == g2)
        {
            CheckView(GUIDE_NORMAL, data1);
        }
        else if (this.guide21 == g1 && this.guide22 == g2)
        {
            CheckView(GUIDE_EXIST, data2);
        }
    }
Exemplo n.º 9
0
 public void Clear()
 {
     if (scene != null)
     {
         s.RemoveChild(scene.group, true);
         scene = null;
     }
     v.RemoveChildren(0, -1, true);
     s.RemoveChildren(0, -1, true);
     f.RemoveChildren(0, -1, true);
     GuideManager.inst.Clear();
     views.Clear();
     scenes.Clear();
     mask      = null;
     sceneMask = null;
     alert     = null;
 }
        public static void Show()
        {
            BaseCharacter teacher = new Teacher()
            {
                Name = "张大钱"
            };
            BaseCharacter master = new Master()
            {
                Name = "卯金刀"
            };
            BaseCharacter student1 = new Students()
            {
                Name = "小舞"
            };
            BaseCharacter student2 = new Students()
            {
                Name = "小二"
            };
            BaseCharacter student3 = new Students()
            {
                Name = "香蕉"
            };
            BaseCharacter student4 = new Students()
            {
                Name = "果冻"
            };

            teacher.SendMessage("今晚八点准时上课!请通知大家", master);
            master.SendMessage("收到,老师,立马通知下去!", teacher);

            master.SendMessage("今天晚上八点上课,不要迟到!", student1);
            Console.WriteLine($"**********************************************");
            {
                //消息一对多,群发消息
                BaseMediator baseMediator = new BaseMediator();
                baseMediator.Add(master);
                baseMediator.Add(student1);
                baseMediator.Add(student2);
                baseMediator.Add(student3);
                baseMediator.Add(student4);

                baseMediator.SendMessage("今天晚上八点上课,不要迟到!", master);
            }
        }
Exemplo n.º 11
0
//    private void On_Left_Change1 ()
//	{
//		roleModel.tab_CurSelect2 = tabC2.selectedIndex;
//        string title_1 = "[0]" + Tools.GetMessageById("19909") + "[/0]";
//        string title_2 = "[0]" + Tools.GetMessageById("19910") + "[/0]";
//        string title_3 = "[0]" + Tools.GetMessageById("19923") + "[/0]";
//        frind_left_tab_1_0.text = Tools.GetMessageColor(title_2, new string[] { normalColor });
//        frind_left_tab_1_1.text = Tools.GetMessageColor(title_3, new string[] { normalColor });
//        frind_left_tab_1_2.text = Tools.GetMessageColor(title_1, new string[] { normalColor });
//        switch (tabC2.selectedIndex)
//		{
//		case 0:
//                bg.visible = true;
//                frind_left_tab_1_0.text = Tools.GetMessageColor(title_2, new string[] { selectColor });
//                this.AddChildView(new MediatorNear(), 1);
//			break;
//		case 1:
//                bg.visible = false;
//                frind_left_tab_1_1.text = Tools.GetMessageColor(title_3, new string[] { selectColor });
//                this.AddChildView(new MediatorTaste(), 1);
//                break;
//		case 2:
//                bg.visible = false;
//                frind_left_tab_1_2.text = Tools.GetMessageColor(title_1, new string[] { selectColor });
//                this.AddChildView(new MediatorSearch(), 1);
//                break;
//		}
//	}

    private void AddChildView(BaseMediator child, int type)
    {
        if (childView != null)
        {
            this.RemoveChild(childView.group, true);
            childView = null;
        }
        childView = child;
        this.AddChild(childView.group);
        BaseMediator.emptyBg = null;
        bg2.visible          = false;
        bg3.visible          = false;
        bg4.visible          = false;

//        Debug.Log("dddddddddd"+type);
        if (type == 1)
        {
            BaseMediator.emptyBg = bg2;
            bg2.visible          = true;
            childView.group.x    = bg2.x;
            childView.group.y    = bg2.y;
        }
        else if (type == 2)
        {
            BaseMediator.emptyBg = bg3;
            bg3.visible          = true;
            childView.group.x    = bg3.x;
            childView.group.y    = bg3.y;
        }
        else if (type == 3)
        {
            BaseMediator.emptyBg = bg4;
            bg4.visible          = true;
            childView.group.x    = bg.x;
            childView.group.y    = bg.y + 55;
        }
        else
        {
            childView.group.x = bg.x;
            childView.group.y = bg.y + 55;
        }
    }
Exemplo n.º 12
0
 private void Mask_Click()
 {
     if (!ModelRole.isCloseMask)
     {
         if (views.Count != 0)
         {
             BaseMediator bm = views[views.Count - 1];
             if (!bm.isAutoClose)
             {
                 return;
             }
         }
         //		mask.alpha = 1;
         this.CloseView();
     }
     else
     {
         ViewManager.inst.ShowText(Tools.GetMessageById("13164"));
     }
 }
        public async Task CreateProductType_ValidRequest_SuccessResult()
        {
            var requestModel = new CreateProductTypeCommand
            {
                ProductTypeKey  = "ProductKey",
                ProductTypeName = "ProductTypeName"
            };


            //Arrange
            BaseMediator.Setup(x => x.Send(requestModel, new CancellationToken())).
            ReturnsAsync(true);
            var productTypesController = new ProductTypesController(BaseMediator.Object);

            //Action
            var result = await productTypesController.Post(requestModel);

            //Assert
            Assert.True(result.Value);
        }
        public async Task GetProductTypeDetailsById_ValidRequest_SuccessResult()
        {
            var productTypeId = Guid.NewGuid();
            var response      = new ProductTypeDetailsResponseModel
            {
                ProductTypeID   = productTypeId,
                ProductTypeKey  = "ProductKey",
                ProductTypeName = "ProductTypeName"
            };


            //Arrange
            BaseMediator.Setup(x => x.Send(It.IsAny <GetProductTypeDetailsQuery>(), new CancellationToken())).
            ReturnsAsync(response);
            var productTypesController = new ProductTypesController(BaseMediator.Object);

            //Action
            var result = await productTypesController.Get(productTypeId);

            //Assert
            Assert.IsType <ActionResult <ProductTypeDetailsResponseModel> >(result);
        }
        public async Task GetProductTypes_ValidRequest_SuccessResult()
        {
            var response = new List <ProductTypeResponseModel>();

            response.Add(new ProductTypeResponseModel
            {
                ProductTypeID   = Guid.NewGuid(),
                ProductTypeKey  = "ProductKey",
                ProductTypeName = "ProductTypeName"
            });

            //Arrange
            BaseMediator.Setup(x => x.Send(It.IsAny <FetchProductTypeQuery>(), new CancellationToken())).
            ReturnsAsync(response);
            var productTypesController = new ProductTypesController(BaseMediator.Object);

            //Action
            var result = await productTypesController.Get();

            //Assert
            Assert.IsType <List <ProductTypeResponseModel> >(result);
        }
Exemplo n.º 16
0
 private void AddChildView(BaseMediator child, int type)
 {
     if (childView != null)
     {
         this.RemoveChild(childView.group, true);
         childView = null;
     }
     childView = child;
     this.AddChild(childView.group);
     if (type == 1)
     {
         childView.group.x = smilPosisition.x;
         childView.group.y = smilPosisition.y;
     }
     else if (type == 2)
     {
         childView.group.x = bigPosition.x;
         childView.group.y = bigPosition.y;
     }
     else
     {
     }
 }
Exemplo n.º 17
0
    public override void Init()
    {
        base.Init();
        this.isAutoClose = false;
        this.Create(Config.VIEW_FREEMATCH, false, Tools.GetMessageById("25024"));

        fightModel           = ModelManager.inst.fightModel;
        userModel            = ModelManager.inst.userModel;
        fightModel.fightType = ModelFight.FIGHT_FREEMATCH1;

//		PlatForm.inst.timeout = 2f;

//		title = view.GetChild ("n1").asTextField;
        btn_Change = this.GetChild("n2").asButton;
        btn_Start  = this.GetChild("n12").asButton;
        btn_Invite = this.GetChild("n13").asButton;

        btn_Change.text = Tools.GetMessageById("33209");
        btn_Start.text  = Tools.GetMessageById("33210");
        btn_Invite.text = Tools.GetMessageById("33211");

        btn_Quit = this.GetChild("n16").asButton;
        btn_Clos = this.GetChild("n31").asButton;
        btn_Bot  = this.GetChild("n11").asButton;
        btn_Chat = this.GetChild("n19").asButton;
        c1       = this.GetController("c1");
        btn_Mil  = this.GetChild("n28").asButton;
        bar      = this.GetChild("n29").asCom as ComProgressBar;
        bar.skin = ComProgressBar.BAR10;
        bar.SetTextVisible(false);
        bar.value = 0;
        bar.max   = 100;

        item0 = this.GetChild("n3").asCom;
        item1 = this.GetChild("n4").asCom;
        item2 = this.GetChild("n5").asCom;
        item3 = this.GetChild("n6").asCom;
        item4 = this.GetChild("n7").asCom;
        item5 = this.GetChild("n8").asCom;
        item6 = this.GetChild("n9").asCom;
        item7 = this.GetChild("n10").asCom;
        help  = this.GetChild("n30").asButton;

        btn_Invite.onClick.Add(Invite_Click);
        btn_Clos.onClick.Add(Close_Click);
        btn_Change.onClick.Add(Change_Click);
        btn_Start.onClick.Add(Start_Click);
        btn_Bot.onClick.Add(Bot_Click);
        btn_Chat.onClick.Add(Chat_Click);
        btn_Quit.onClick.Add(Close_Click);
        help.onClick.Add(Help_Click);

        userModel.GetUnlcok(Config.UNLOCK_FREEMATCH2, btn_Change);

//		public int[] freeType1 = new int[]{ 0, 1, 2, 3, 4, 5, 6, 7 };
//		public int[] freeType2 = new int[]{ 0, 1, 4, 5, 2, 3, 6, 7 };
        if (fightModel.freeType == 1)
        {
            items = new GComponent[8] {
                item0, item1, item2, item3, item4, item5, item6, item7
            }
        }
        ;
        else
        {
            items = new GComponent[8] {
                item0, item1, item4, item5, item2, item3, item6, item7
            }
        };
        this.SetDefault();
        if (fightModel.isRequest)
        {
            NetSocket.inst.AddListener(NetBase.SOCKET_NEWROOM, (VoSocket vo) =>
            {
                NetSocket.inst.RemoveListener(NetBase.SOCKET_NEWROOM);
                fightModel.CreateFreeTeam(vo.data);
                UpdateItems();
                CheckMode();
                btn_Bot.visible = fightModel.isLeader;
            });

            Dictionary <string, object> data = new Dictionary <string, object> ();
            data ["mode"] = fightModel.freeType;
            NetSocket.inst.Send(NetBase.SOCKET_NEWROOM, data);
        }
        else
        {
            CheckMode();
            UpdateItems();
            btn_Bot.visible = fightModel.isLeader;
        }

        micro = new MediatorMicro();
        ViewManager.inst.AddTopView(micro);
//		micro.visible = false;

        NetSocket.inst.AddListener(NetBase.SOCKET_ADDUSER, (VoSocket vo) =>
        {
            fightModel.ChangeFreeTeam(vo.data);
            UpdateItems();
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_REMOVEUSER, (VoSocket vo) =>
        {
            bool b = fightModel.DelFreeTeam(vo.data);
            if (b)
            {
                fightModel.Clear();
                ViewManager.inst.CloseView(this);
                ViewManager.inst.ShowText(Tools.GetMessageById("25011"));
            }
            else
            {
                UpdateItems();
            }
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_KILLROOMPUSH, (VoSocket vo) =>
        {
            fightModel.Clear();
            ViewManager.inst.CloseView(this);
            ViewManager.inst.ShowText(Tools.GetMessageById("25008"));
            Log.debug("解散队伍");
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_FREESTARTMATCHPUSH, (VoSocket vo) =>
        {
            if (fightModel.freeType == 1)
            {
                fightModel.fightType = ModelFight.FIGHT_FREEMATCH1;
            }
            else
            {
                fightModel.fightType = ModelFight.FIGHT_FREEMATCH2;
            }
            Log.debug("进入战斗");
            ViewManager.inst.ShowScene <MediatorFightWorld> (true);
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_CHANGEMODEPUSH, (VoSocket vo) =>
        {
            Dictionary <string, object> da = (Dictionary <string, object>)vo.data;
            fightModel.freeType            = Convert.ToInt32(da ["new_mode"]);
            CheckMode(true);
            Log.debug("更换模式");
//			ViewManager.inst.ShowText (Tools.GetMessageById ("25021"));
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_CHANGEPOSPUSH, (VoSocket vo) =>
        {
            fightModel.RepalceFreeTeam(vo.data);
            CheckMode(true);
            Log.debug("更换位置");
//			ViewManager.inst.ShowText (Tools.GetMessageById ("25021"));
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_FREECHATPUSH, (VoSocket vo) =>
        {
            if (userModel.IsChatVoice())
            {
                fightModel.AddMicro(vo.data);
            }
        });

        this.AddGlobalListener(MainEvent.SOCKET_CLOSE, (MainEvent e) =>
        {
            this.Close();
        });
    }
Exemplo n.º 18
0
 public void RemoveTopView(BaseMediator view)
 {
     f.RemoveChild(view.group, true);
 }
Exemplo n.º 19
0
 public void AddPView(BaseMediator view)
 {
     SetPMask();
     p.AddChild(view.group);
 }
Exemplo n.º 20
0
    public override void Init()
    {
        base.Init();
        this.isAutoClose = false;
        this.Create(Config.VIEW_TEAMMATCH, false);

//		PlatForm.inst.timeout = 20000f;

        fightModel = ModelManager.inst.fightModel;
        roleModel  = ModelManager.inst.roleModel;
        userModel  = ModelManager.inst.userModel;

        fightModel.fightType = ModelFight.FIGHT_MATCHTEAM;

        list           = this.GetChild("n2").asList;
        btn_Enter      = this.GetChild("n3").asButton;
        btn_Enter.text = Tools.GetMessageById("25062");
        btn_Invite     = this.GetChild("n4").asButton;
        c1             = this.GetController("c1");
        text1          = this.GetChild("n7").asTextField;
        text2          = this.GetChild("n8").asTextField;

        text3 = this.GetChild("n9").asTextField;
        //
        btn_Cancel      = this.GetChild("n6").asButton;
        btn_Cancel.text = Tools.GetMessageById("14025");
        btn_Quit        = this.GetChild("n29").asTextField;
        btn_Chat        = this.GetChild("n18").asButton;
        //btn_Chat.text = Tools.GetMessageById("25067");
        btn_Mil = this.GetChild("n19").asButton;
        btn_Mil.GetChild("n2").asTextField.text = Tools.GetMessageById("25067");
        bar      = this.GetChild("n20").asCom as ComProgressBar;
        bar.skin = ComProgressBar.BAR10;
        bar.SetTextVisible(false);
        bar.value = 0;
        bar.max   = 100;

        btn_Close = this.GetChild("close").asButton;
        btn_Close.onClick.Add(this.Close);
        //
        this.GetChild("title").asTextField.text = Tools.GetMessageById("25033");
        //
        btn_Enter.onClick.Add(Enter_Click);
        btn_Invite.onClick.Add(Invite_Click);
        btn_Cancel.onClick.Add(Cancel_Click);
//		btn_Quit.onClick.Add (Quit_Click);
        btn_Quit.text = Tools.GetMessageById("25058");
        btn_Chat.onClick.Add(Chat_Click);
        btn_Mil.onClick.Add(Chat_Click_Over);
        fightModel.isMatch = false;

        //麦克风功能
        micro = new MediatorMicro();
        ViewManager.inst.AddTopView(micro);
        //房间内部操作
        NetSocket.inst.AddListener(NetBase.SOCKET_TEAMMATCH, (VoSocket vo) =>
        {
//				Debug.LogError("NetSocket.inst.AddListener");
            if (vo.data is Boolean)
            {
                bool isOk = Convert.ToBoolean(vo.data);
                if (!isOk)
                {
                    ViewManager.inst.ShowText(Tools.GetMessageById("25026"));
                    TimerManager.inst.Remove(Time_Tick);
                    fightModel.isMatch = false;
                    list.numItems      = 4;
                    if (fightModel.isLeader)
                    {
                        c1.selectedIndex = 0;
                    }
                    else
                    {
                        c1.selectedIndex = 1;
                    }
                }
            }
            else
            {
                Dictionary <string, object> data = (Dictionary <string, object>)vo.data;
                fightModel.team1 = (object[])data ["team"];
                list.numItems    = 4;             //fightModel.team1.Length;

                c1.selectedIndex = 4;
                this.closeEnable = false;
                text3.text       = Tools.GetMessageById("25064");
                TimerManager.inst.Add(5f, 1, (float t) =>
                {
                    TimerManager.inst.Remove(Time_Tick);
                    c1.selectedIndex = 4;
                    //					Log.debug ("准备开始 - " + vo.data.ToString ());

                    DispatchManager.inst.Dispatch(new MainEvent(MainEvent.START_FIGHT, data));
                });
            }
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_STARTMATCHPUSH, (VoSocket vo) =>
        {
            fightModel.isMatch = true;
            list.numItems      = 4;       //fightModel.team1.Length;

//			NetSocket.inst.RemoveListener (NetBase.SOCKET_STARTMATCH);
            if (fightModel.isLeader)
            {
                c1.selectedIndex = 2;
            }
            else
            {
                c1.selectedIndex = 3;
            }

            fightModel.preTime   = Convert.ToInt32(vo.data);
            fightModel.matchTime = 0;
//			Log.debug ("开始匹配 - " + fightModel.preTime.ToString ());
            if (fightModel.isLeader)
            {
                text1.text = Tools.GetMessageById("25005", new string[] {
                    fightModel.preTime.ToString(),
                    fightModel.matchTime.ToString()
                });
            }
            else
            {
                text2.text = Tools.GetMessageById("25005", new string[] {
                    fightModel.preTime.ToString(),
                    fightModel.matchTime.ToString()
                });
            }
            TimerManager.inst.Add(1f, 0, Time_Tick);
//			ViewManager.inst.ShowText (Tools.GetMessageById ("25013"));
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_ACCEPTINVITEOTHER, (VoSocket vo) =>
        {
            string uid    = fightModel.AddTeam(vo.data);
            list.numItems = 4;            //fightModel.team1.Length;
            ViewManager.inst.ShowText(Tools.GetMessageById("25012", new String[] { uid }));
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_KILLTEAMPUSH, (VoSocket vo) =>
        {
            fightModel.Clear();
            ViewManager.inst.CloseView(this);
            ViewManager.inst.ShowText(Tools.GetMessageById("25008"));
//			Log.debug ("解散队伍 - " + vo.data.ToString ());
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_QUITTEAMPUSH, (VoSocket vo) =>
        {
//			if (vo.data is Boolean && !Convert.ToBoolean (vo.data))
//			{
//				ViewManager.inst.ShowText (Tools.GetMessageById ("25016"));
//				return;
//			}
            string uid = vo.data.ToString();
            if (userModel.uid == uid)
            {
                ViewManager.inst.CloseView(this);
                ViewManager.inst.ShowText(Tools.GetMessageById("25011"));
//				Log.debug ("退出队伍 - " + vo.data.ToString ());
            }
            else
            {
                fightModel.ChangeTeam(vo.data);
                list.numItems = 4;
                if (fightModel.isLeader)
                {
                    c1.selectedIndex = 0;
                }
                else
                {
                    c1.selectedIndex = 1;
                }
                this.btn_Enter.enabled = false;
                TimerManager.inst.Add(2f, 1, (float t) =>
                {
                    this.btn_Enter.enabled = true;
                });
            }
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_CANCELMATCHPUSH, (VoSocket vo) =>
        {
            if (!Convert.ToBoolean(vo.data))
            {
                return;
            }
            fightModel.isMatch = false;
            if (fightModel.isLeader)
            {
                c1.selectedIndex = 0;
            }
            else
            {
                c1.selectedIndex = 1;
            }
            TimerManager.inst.Remove(Time_Tick);
            ViewManager.inst.ShowText(Tools.GetMessageById("25015"));
        });

        NetSocket.inst.AddListener(NetBase.SOCKET_MATCHTEAMCHATPUSH, (VoSocket vo) =>
        {
            if (userModel.IsChatVoice())
            {
                fightModel.AddMicro(vo.data);
            }
        });

        this.AddGlobalListener(MainEvent.SOCKET_CLOSE, (MainEvent e) =>
        {
            this.Close();
        });
        //
        this.InitData();
    }
Exemplo n.º 21
0
 //取消注册输入监听
 public override void OnRemove()
 {
     BaseMediator.UnlockAllKeys();
     this.DownloadPageView.StopSignal.RemoveListener(this.OnStopDownload);
     base.OnRemove();
 }
Exemplo n.º 22
0
 //全屏特殊
 public void AddTopView(BaseMediator view)
 {
     f.AddChild(view.group);
 }
Exemplo n.º 23
0
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("欢迎来到.net高级班公开课之设计模式特训,今天是Eleven老师为大家带来的中介者模式");

                BaseCharacter teacher = new Teacher()
                {
                    Name = "Eleven"
                };

                BaseCharacter master = new Master()
                {
                    Name = "落单的候鸟"
                };


                BaseCharacter student1 = new Student()
                {
                    Name = "yoyo"
                };
                BaseCharacter student2 = new Student()
                {
                    Name = "小昶"
                };
                BaseCharacter student3 = new Student()
                {
                    Name = "木偶"
                };
                BaseCharacter student4 = new Student()
                {
                    Name = "一点半"
                };
                BaseCharacter student5 = new Student()
                {
                    Name = "初出茅庐"
                };
                Console.WriteLine("*********************************");

                teacher.SendMessage("今天晚上八点上课啦,,", master);
                Console.WriteLine("*********************************");
                master.SendMessage("老师,收到,马上通知大家", teacher);
                Console.WriteLine("*********************************");
                master.SendMessage("今天晚上八点上课,大家不要错过哦", student1);
                Console.WriteLine("*********************************");

                //候鸟需要发消息给全部的学员
                master.SendMessage("今天晚上八点上课,大家不要错过哦", student2);
                Console.WriteLine("*********************************");
                master.SendMessage("今天晚上八点上课,大家不要错过哦", student3);
                Console.WriteLine("*********************************");
                master.SendMessage("今天晚上八点上课,大家不要错过哦", student4);
                Console.WriteLine("*********************************");
                Console.WriteLine("*********************************");
                Console.WriteLine("*********************************");

                {
                    BaseMediator mediator = new BaseMediator();
                    mediator.AddCharacter(master);
                    mediator.AddCharacter(student1);

                    mediator.SendMessage("今天晚上八点上课,大家不要错过哦", master);

                    Console.WriteLine("*********************************");

                    mediator.SendMessage("收到,一定准时前来", student4);
                }

                {
                    BaseMediator mediator = new BaseMediator();
                    mediator.AddCharacter(teacher);
                    mediator.AddCharacter(master);
                    mediator.AddCharacter(student1);
                    mediator.AddCharacter(student2);
                    mediator.AddCharacter(student3);
                    mediator.AddCharacter(student4);
                    mediator.AddCharacter(student5);

                    mediator.SendMessage("今天晚上八点上课,大家不要错过哦", master);

                    Console.WriteLine("*********************************");

                    mediator.SendMessage("收到,一定准时前来", student4);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.Read();
        }