private void OnChangeIconHandler(MainEvent e)
 {
     if (img_icon != null)
     {
         img_icon.url = Tools.GetResourceUrl("Icon:" + MediatorChangeIcon.iconID);
     }
 }
Example #2
0
 public static void AddJobToQueue(BackgroundJob job)
 {
     //Logger.Info("adding job " + job.Event.Description + " to backgorund queue");
     BackgroundWorkerQueue.Enqueue(job);
     MainEvent.Set();
     MainEvent.Reset(); // must call reset right after set, else the next call to WaitOne will not block
 }
Example #3
0
    private void ViewUpdate(MainEvent e)
    {
        Dictionary <string, object> obj1 = (Dictionary <string, object>)e.data;
        string tag = (string)obj1["tag"];

        if (tag.Equals("chphone"))
        {
            phone.text = Tools.GetUserTel(userModel.tel)[1];
        }
        if (tag.Equals("account"))
        {
            InitDate();
        }
        if (tag.Equals("uname"))
        {
            if (type_bing.Equals(Ex_Local.LOGIN_TYPE_TEL))
            {
                textName.text = userModel.uname;
            }
            else
            {
                textName_.text = userModel.uname;
            }
        }
        if (tag.Equals("photo"))
        {
            //Tools.SetLoaderButtonUrl(head_Icon, ModelUser.GetHeadUrl(userModel.));
        }
    }
Example #4
0
 public void DispatchEvent(MainEvent e)
 {
     if (null != instance)
     {
         instance.Dispatch(e);
     }
 }
Example #5
0
 private void MICRO_ADD(MainEvent e)
 {
     list.numItems = fightModel.micros.Count;
     list.visible  = list.numItems == 0 ? false : true;
     this.height   = fightModel.micros.Count * 50 + (fightModel.micros.Count - 1) * 5;
     this.y        = 0;
 }
Example #6
0
 private void CHAT_GUILDJOIN(MainEvent e)
 {
     if (this.view != null && this.view.parent != null)
     {
         NetHttp.inst.Send(NetBase.HTTP_GUILD_INDEX, "", GetGuildInfo);
     }
 }
 private void OnChangeIconHandler(MainEvent e)
 {
     if (icon != MediatorChangeIcon.iconID)
     {
         NetHttp.inst.Send(NetBase.HTTP_GUILD_SETUP_CHANGE, "icon=" + MediatorChangeIcon.iconID, OnChangeIconFunction);
     }
 }
    private void ViewUpdata(MainEvent e)
    {
        int tag = (int)e.data;

        if (tag == 1)
        {
            if (listDataHttp != null)
            {
                listDataHttp.Clear();
            }
            if (listDataSocket != null)
            {
                listDataSocket.Clear();
            }
            if (listStatusTemp != null)
            {
                listStatusTemp.Clear();
            }
            if (listUid != null)
            {
                listUid.Clear();
            }
            m_PageIndex  = 1;
            m_PageCount  = 1;
            m_PageIndexS = 1;
            SendNetMesage("");
        }
    }
Example #9
0
    private void OnlevelUp(MainEvent e)
    {
//		if (GuideManager.inst.Check ("1:3"))
//		{
//			GuideManager.inst.Next ();
//			GuideManager.inst.Show (this);
//		}
        if (this.GetChild("n46") != null)
        {
            this.RemoveChild(this.GetChild("n46"));
        }
        if (oldred != (int)userModel.records [Config.ASSET_REDBAGCOIN])
        {
            ViewManager.inst.ShowGetRedBagCoin((int)userModel.records[Config.ASSET_REDBAGCOIN] - oldred, v2);
        }
        oldred = (int)userModel.records [Config.ASSET_REDBAGCOIN];
        if (((int)DataManager.inst.redbag ["exp"] * (int)userModel.records [Config.ASSET_REDBAGCOIN] + userModel.exp) >= userModel.GetExpMax(userModel.lv))
        {
            if (userModel.lv < 15) //目前满级15  有可能会变
            {
                ViewManager.inst.ShowAlert(Tools.GetMessageById("13110"), (int bo) => {
                    if (bo == 1)
                    {
                        ViewManager.inst.ShowView <MediatorRedPackage>();
                    }
                }, true);
            }
        }
        Tab_Change();
    }
    private void RedUpdate(MainEvent e)
    {
        if (tabC2.selectedIndex == 0)
        {
            int fans_count = userModel.Get_NoticeState(ModelUser.RED_FANS);
            if (fans_count > 0)
            {
                userModel.Add_Notice(frind_left_tab_1, new UnityEngine.Vector2(150, 0), fans_count, false);
            }
            else
            {
                userModel.Remove_Notice(frind_left_tab_1);
            }

            int follow_count = userModel.Get_NoticeState(ModelUser.RED_FOLLOW);
            if (follow_count > 0)
            {
                userModel.Add_Notice(frind_left_tab_0, new UnityEngine.Vector2(150, 0), follow_count, false);
            }
            else
            {
                userModel.Remove_Notice(frind_left_tab_0);
            }
        }
        else if (tabC2.selectedIndex == 1)
        {
            userModel.Remove_Notice(frind_left_tab_1);
            userModel.Remove_Notice(frind_left_tab_0);
        }
    }
Example #11
0
 public void AddEvent(MainEvent mainEvent)
 {
     lstEvents.ItemsSource = null;
     listEvents.Add(mainEvent);
     lstEvents.ItemsSource  = listEvents;
     lstEvents.SelectedItem = listEvents[(listEvents.Count - 1)];
 }
        public async Task ShouldUpdateMainEvent()
        {
            MainEventService    mainEventService    = new MainEventService(_dbContext, _userManager);
            SecurityService     securityService     = new SecurityService(_dbContext, _userManager, _roleManager);
            MainEventController mainEventController = new MainEventController(mainEventService, securityService);

            CreateUser();
            SetUser(mainEventController, _createdUser.Entity.Id);
            CreateMainEvents();

            string   newName      = "Test name 3";
            DateTime newStartTime = DateTime.Now.AddDays(4);
            DateTime newEndTime   = DateTime.Now.AddDays(8);

            MainEventVm mainEventVm = new MainEventVm {
                Id = 2, Name = newName, StartDateTime = newStartTime, EndDateTime = newEndTime, VenueId = 2, OrganizerId = 2
            };

            await mainEventController.UpdateMainEventAsync(mainEventVm);

            // Check that only one has been changed
            MainEvent mainEvent1 = _dbContext.MainEvents.Find(2);

            Assert.AreEqual(newName, mainEvent1.Name);
            Assert.AreEqual(newStartTime, mainEvent1.StartDateTime);
            Assert.AreEqual(newEndTime, mainEvent1.EndDateTime);
        }
Example #13
0
 /// <summary>
 /// Resolve all the Paragraph Mains Events
 /// </summary>
 /// <param name="story"></param>
 public void Resolve(Story story)
 {
     foreach (Event MainEvent in MainEvents)
     {
         try
         {
             MainEvent.ResolveEvent(story);
         }
         catch (YouAreDeadException)
         {
             throw;
         }
         catch (WeaponHolderFullException)
         {
             throw;
         }
         catch (BackPackFullException)
         {
             throw;
         }
     }
     if (!MainEvents.OfType <FightEvent>().Any())
     {
         story.PlayerHero.Rest();
     }
 }
Example #14
0
 private void updateEdge(MainEvent obj)
 {
     for (int i = 0, len = this.edgeHintList.Count; i < len; i++)
     {
         this.edgeHintList[i].updatePosition();
     }
 }
Example #15
0
 void AlignEvents(MainEvent mevent)
 {
     foreach (KeyValuePair <string, IExt> kvp in this)
     {
         kvp.Value.AlignEvent(mevent);
     }
 }
Example #16
0
 private void CHANGE_GUILD_NAME(MainEvent e)
 {
     if (this.GetChild("n14").asTextField != null)
     {
         this.GetChild("n14").asTextField.text = ModelManager.inst.guildModel.my_guild_info ["name"] as string;
     }
 }
Example #17
0
 private void RedUpdate(MainEvent e)
 {
     if (otherRole["uid"].ToString().Equals(userModel.uid))
     {
         if (tabC2.selectedIndex == 0)
         {
             int count = userModel.Get_NoticeState(ModelUser.RED_MSGBOARD);
             if (count > 0)
             {
                 userModel.Add_Notice(btn, new UnityEngine.Vector2(145, -12), count, false);
             }
             else
             {
                 userModel.Remove_Notice(btn);
             }
         }
         else
         {
             userModel.Remove_Notice(btn);
         }
         //if(tabC2.selectedIndex == 0 && tabC1.selectedIndex == 2)
         //{
         //    userModel.Remove_Notice(btn);
         //}
     }
 }
Example #18
0
    private void OnExcFunction(MainEvent e)
    {
        MediatorChangeIcon.iconID = "g01";
        if (e.data != null)
        {
            if ((int)e.data == 100)
            {
                jiaru = true;
                return;
            }
            else if ((int)e.data == 10)
            {
                ViewManager.inst.ShowText(Tools.GetMessageById("20161"));
                chatModel.Clear_RedCount();
            }
            else
            {
//				roleModel.tab_CurSelect2 = (int)e.data;
            }
            if ((int)e.data == 954)
            {
                tipSetUp = true;
//				roleModel.tab_CurSelect2 = -1;
            }
        }
        else
        {
//			roleModel.tab_CurSelect2 = -1;
        }
        NetHttp.inst.Send(NetBase.HTTP_GUILD_INDEX, "", GetGuildInfo);
    }
Example #19
0
 public override void _ExitTree()
 {
     MainEvent.UnregisterListener(UIEventFired);
     UnitDeathEvent.UnregisterListener(EndGame);
     WinEvent.UnregisterListener(WinTriggered);
     LoseEvent.UnregisterListener(LostTriggered);
 }
Example #20
0
    private void OnUpdataHandler(MainEvent e = null)
    {
        DateTime date    = (DateTime)ModelManager.inst.userModel.records ["redbag_time"];
        DateTime nowDate = ModelManager.inst.gameModel.time;
        bool     isToday = true;

        if (date.Year != nowDate.Year || date.Month != nowDate.Month || date.Day != nowDate.Day)
        {
            isToday = false;
        }
        TimerManager.inst.Add(1f, 0, Time_Tick);
        Time_Tick(0f);
        if (this.text != null)
        {
            this.text = Tools.GetMessageById("12011", new string[] { ((object[])redbagCfg["redbag_pool"]).GetLength(0) + "" });
            if (isToday)
            {
                this.text = Tools.GetMessageById("12011", new string[] { (((object[])redbagCfg["redbag_pool"]).GetLength(0) - (int)(ModelManager.inst.userModel.records ["redbag_times"])) + "" });
            }
        }
        if (l_redcoin != null)
        {
            l_redcoin.text = "X " + ((int)(ModelManager.inst.userModel.records ["redbag_coin"]) < 0 ? 0 : (int)(ModelManager.inst.userModel.records ["redbag_coin"])) + "";
//			l_redcoin.text = ((int)(ModelManager.inst.userModel.records ["redbag_coin"]) < 0 ? 0 : (int)(ModelManager.inst.userModel.records ["redbag_coin"])) + "";
        }
    }
Example #21
0
        void Start_Query()
        {
            BackgroundWorker bw = new BackgroundWorker();

            bw.DoWork += (s, arg) =>
            {
                try
                {
                    arg.Result = DAL.Task.Task_Repository.GetDisplayCurrentTask();
                }
                catch (Exception ex)
                {
                    EventLog.WriteEntry("Display", ex.Message, EventLogEntryType.Error);
                }
            };

            bw.RunWorkerCompleted += (s, arg) =>
            {
                if (arg.Error == null)
                {
                    if (arg.Result != null)
                    {
                        MainEvent.ConfirmData((BOL.Task.objTask)arg.Result);
                    }
                }
                else
                {
                    Prompt_No_Connection();
                }
                Start_Query();
            };
            bw.RunWorkerAsync();
        }
Example #22
0
 private void partStartHandler(MainEvent e)
 {
     this._color          = ViewConstant.SHADER_COLOR_STANDARD;
     this._material.color = this._color;
     ViewUtils.setEnable(this.gameObject, true);
     ViewUtils.colorInOutMaterial(this.gameObject, this._material, ViewConstant.SHADER_COLOR_YELLOW, ViewConstant.SHADER_COLOR_STANDARD, 0.05f, 0.2f);
 }
Example #23
0
    private void ShareResult(MainEvent e)
    {
        string a = e.data + "";

        switch (a)
        {
        case "1":
            btn_yaoqing.touchable = false;
            btn_yaoqing.grayed    = true;
            break;

        case "2":
            //string str0 = Tools.GetMessageById("19438", new string[] { "[0]" + GetShareNum() + "[/0]" });
            //text1.text = BaseUbbParser.inst.Parse(Tools.GetMessageColor(str0, new string[] { "DE8006" }));
            //((Dictionary<string, object>)userModel.records["share_data"])["sum_num"] = (int)((Dictionary<string, object>)userModel.records["share_data"])["sum_num"] + 1;
            //((Dictionary<string, object>)userModel.records["share_data"])["succ_times"] = (int)((Dictionary<string, object>)userModel.records["share_data"])["succ_times"] + 1;
            //((Dictionary<string, object>)userModel.records["share_data"])["succ_time"] = ModelManager.inst.gameModel.time;
            InitData();
            FindObject();
            SetData();
            break;

        case "3":
            ((Dictionary <string, object>)userModel.records["share_data"])["sum_n"] = (int)((Dictionary <string, object>)userModel.records["share_data"])["sum_n"] + 1;
            userModel.ipList += 1;;
            ((Dictionary <string, object>)userModel.records["share_data"])["week_n"] = (int)((Dictionary <string, object>)userModel.records["share_data"])["week_n"] + 1;
            ((Dictionary <string, object>)userModel.records["share_data"])["t"]      = ModelManager.inst.gameModel.time;
            InitData();
            SetData();
            break;
        }
    }
Example #24
0
    private void Onfunction(MainEvent e)
    {
        string[] str = e.data as string[];
        pro_pro.value += Convert.ToInt32(str [1]);
        if (pro_pro.value > pro_pro.max)
        {
            pro_pro.value = pro_pro.max;
        }

//		DOTween.Kill (pro_pro, true);
        if (proTween != null)
        {
            proTween.Kill();
        }
        proTween = pro_pro.TweenMoveY(18, 0.05f).OnComplete(() =>
        {
            pro_pro.y = 29;
        });
        ComGoldCoinExp.Elcount--;
        if (ComGoldCoinExp.Elcount <= 0)
        {
            ComGoldCoinExp.Elcount = 0;
            this.DispatchGlobalEvent(new MainEvent(MainEvent.JUMPEL_OVER));
        }
    }
Example #25
0
        public void RunningThread()
        {
            int     i       = MaxQueue;
            Message message = new Message();

            message.Title = "keepeya";
            while (true)
            {
                if (listEvents.Count > 0) // делаем запрос к БД
                {
                    message.Result    = null;
                    message.Account   = null;
                    message.AllEvents = new MainEvent[listEvents.Count];
                    for (int index = 0; index < listEvents.Count; index++)
                    {
                        message.AllEvents[index] = listEvents[index];
                    }
                    Message recieveMessage = parent.SendToServer(message);
                    if (recieveMessage != null && recieveMessage.Result != null)
                    {
                        for (int index = 0; index < recieveMessage.AllEvents.Length; index++)
                        {
                            if (recieveMessage.AllEvents[index].EventDone || recieveMessage.AllEvents[index].EventError != "")
                            // если событие произошло
                            {
                                MainEvent temp = listEvents.FirstOrDefault(
                                    c => c.Title == recieveMessage.AllEvents[index].Title &&
                                    c.Sign == recieveMessage.AllEvents[index].Sign &&
                                    c.ValueParam == recieveMessage.AllEvents[index].ValueParam
                                    );
                                if (recieveMessage.AllEvents[index].EventError == "")
                                {
                                    Interlocked.Increment(ref eventMessage);
                                    // отправляем еmail
                                    SendEmail sendMail = new SendEmail(parent.MyAccount.Email, "Событие произошло", temp.ToString());
                                    // отправляем сообщение по Skype
                                    SendSkype sendSkype = new SendSkype(parent.MyAccount.LoginSkype, temp.ToString());
                                    listResultEvents.Add(temp);
                                }
                                else
                                {
                                    MessageBox.Show(recieveMessage.AllEvents[index].EventError + " " + recieveMessage.AllEvents[index].Title);
                                }
                                // удаляем событие
                                listEvents.Remove(temp);
                                UpdateListEvent();
                            }
                        }
                    }
                }
                valueList.Enqueue(new KeyValuePair <int, int>((++i), eventMessage));
                if (valueList.Count > MaxQueue)
                {
                    valueList.Dequeue();
                }
                Message(i);
                Thread.Sleep(threadDelay * 1000);
            }
        }
Example #26
0
 private void onBirthHandler(MainEvent e)
 {
     LeanTween.cancel(this.gameObject, true);
     this.changeMove(1, true);
     base.changeDir(1);
     this.gameObject.SetActive(true);
     LeanTween.scale(this.gameObject, new Vector3(1, 1, 1), 0.5f);
 }
Example #27
0
 private void UIEventFired(MainEvent mainEvent)
 {
     //If the ui is activated then we start the game
     if (mainEvent.startBtnPressed)
     {
         GameStart();
     }
 }
Example #28
0
 private void initCards(MainEvent e = null)
 {
     for (int i = 0, len = this.player.cardGroup.handCards.Count; i < len; i++)
     {
         this._initCards[i].cardData = this.player.cardGroup.handCards[i];
     }
     this.player.cardGroup.addListener(EventConstant.CHANGE, initCards);
 }
Example #29
0
 private void OnUnlockHandler(MainEvent e)
 {    //动画效果
     userExplore = (Dictionary <string, object>)(userModelr.records ["explore"]);
     TimerManager.inst.Remove(Time_Tick);
     TimerManager.inst.Add(1f, 0, Time_Tick);
     Time_Tick(0f);
     type = 1;
 }
Example #30
0
 public void dispatchEvent(MainEvent e)
 {
     e.target = this;
     if (null != instance)
     {
         instance.Dispatch(e);
     }
 }