Example #1
0
 private void SceneLoaded(Scene scene, LoadSceneMode mode)
 {
     ZLog.Log("SceneController...the scene had loaded that name = " + scene.name + ";mode = " + mode);
     currentScene = scene.name;
     AddOne(scene);
     NotifyManager.SendNotify(Enum.NotifyType.OnSceneLoaded, currentScene);
 }
Example #2
0
 public void RemoveAllEvent()
 {
     foreach (KeyValuePair <string, NotifyManager.StandardDelegate> kv in m_eventMap)
     {
         NotifyManager.RemoveEventHandler(kv.Key, kv.Value);
     }
 }
Example #3
0
    // Start is called before the first frame update
    protected void Start()
    {
        if (activeEventName.Length > 0)
        {
            NotifyManager.AddListener(activeEventName, this);
        }

        if (inactiveEventName.Length > 0)
        {
            NotifyManager.AddListener(inactiveEventName, this);
        }

        foreach (var gb in fadeRoots)
        {
            var arr = gb.GetComponentsInChildren <Graphic>();
            AddToGraphicDict(arr);
        }
        AddToGraphicDict(images);
        AddToGraphicDict(texts);


        if (!IsOn)
        {
            //SetGrphicsDisActive(images);
            //SetGrphicsDisActive(texts);
            //SetGrphicsDisActive(rootGraphics);
            SetGrphicsDisActive();
        }
    }
Example #4
0
        private ImageInfo AddImage(byte[] buffer, RequestInfo info, string path, Vector2 size)
        {
            if (buffer != null && size.x > 10 && size.y > 10)
            {
                //ZLog.Warning("generate texture bytes start...." + Time.realtimeSinceStartup);
                //byte[] buffer = tex.EncodeToPNG();
                //ZLog.Warning("generate texture bytes end...." + Time.realtimeSinceStartup);
                if (!string.IsNullOrEmpty(path))
                {
                    FileManager.Instance.WriteFile(path, buffer);
                }
                Texture2D texture = CreateTexture(buffer, new Vector2(size.x, size.y));
                ImageInfo detail  = new ImageInfo(info.uid, info.identify, texture, info.url, info.flag)
                {
                    local = false
                };
                loadedList.Add(detail);

                NotifyManager.SendNotify(NotifyType.OnImageUpdate, detail);
                return(detail);
            }
            else
            {
                ZLog.Warning("texture is null...");
                return(null);
            }
        }
Example #5
0
File: User.cs Project: radtek/EMIP
        public virtual JObject GetCurrentNotificationSetting(HttpContext context)
        {
            string account = YZAuthHelper.LoginUserAccount;

            NotifyProviderInfoCollection providers;
            UserCommonInfo userCommonInfo;

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();

                providers      = NotifyManager.GetProviders(cn);
                userCommonInfo = UserCommonInfo.FromAccount(cn, account);
            }

            JObject rv         = new JObject();
            JArray  jProviders = new JArray();

            rv["providers"] = jProviders;
            foreach (NotifyProviderInfo provider in providers)
            {
                JObject jProvider = new JObject();
                jProviders.Add(jProvider);

                jProvider["ProviderName"] = provider.Name;
                jProvider["Enabled"]      = !userCommonInfo.RejectedNotifys.Contains(provider.Name);
            }

            rv[YZJsonProperty.success] = true;
            return(rv);
        }
        public void AddFormulaData(object sender, EventArgs e)
        {
            string formulaName = m_View.GetFormulaName();

            if (formulaName == "")
            {
                MessageBoxDialog.Show(
                    StringHelper.GetInstance().getStringValue(LanguageHelper.TrendViewer_Msg_EmptyName, LanguageHelper.TrendViewer_Msg_EmptyName_EN),
                    StringHelper.GetInstance().getStringValue(LanguageHelper.TrendViewer_Msg_ErrTitle, LanguageHelper.TrendViewer_Msg_ErrTitle_EN),
                    MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            if (!FormulaNameValid(formulaName))  //means has duplicate names
            {
                MessageBoxDialog.Show(
                    StringHelper.GetInstance().getStringValue(LanguageHelper.TrendViewer_Msg_DuplicateName, LanguageHelper.TrendViewer_Msg_DuplicateName_EN),
                    StringHelper.GetInstance().getStringValue(LanguageHelper.TrendViewer_Msg_ErrTitle, LanguageHelper.TrendViewer_Msg_ErrTitle_EN),
                    MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            NotifyManager.GetInstance().Send(DataNotificaitonConst.AddFormula, m_View.ViewID, m_View.GetNewFormula());
            m_View.DestroyView();
        }
Example #7
0
        public async Task <ActionResult> ChangePassword(UserChangePasswordViewModel model)
        {
            if (!ModelState.IsValid)
            {
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                return(PartialView(model));
            }

            if (model.NewPassword != model.NewPasswordCopy)
            {
                ModelState.AddModelError("", "The new password and confirmation password does not match.");
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                return(PartialView(model));
            }

            AppUser user = GetCurrentUser();

            bool correctPass = await _userManager.CheckPasswordAsync(user, model.OldPassword);

            if (!correctPass)
            {
                ModelState.AddModelError("", "Please enter valid current password.");
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                return(PartialView(model));
            }

            IdentityResult validPass = await _userManager.PasswordValidator.ValidateAsync(model.NewPassword);

            if (validPass.Succeeded)
            {
                user.PasswordHash = _userManager.PasswordHasher.HashPassword(model.NewPassword);
            }
            else
            {
                AddErrorsFromResult(validPass);
            }

            if (validPass == null || (model.NewPassword != string.Empty && validPass.Succeeded))
            {
                IdentityResult result = await _userManager.UpdateAsync(user);

                if (result.Succeeded)
                {
                    _mailingRepository.PasswordChangedMail(user.Email);
                    NotifyManager.Set("notification-success", "Success!", "Your password has been changed!");
                    return(Json(new { url = Url.Action("Index") }));
                }
                else
                {
                    AddErrorsFromResult(result);
                }
            }
            else
            {
                ModelState.AddModelError("", "User Not Found");
            }
            Response.StatusCode = (int)HttpStatusCode.BadRequest;
            return(PartialView(model));
        }
Example #8
0
        public void TestGetInstance01()
        {
            //test Procedure call
            NotifyManager notifyManager = NotifyManager.GetInstance();

            //Post check
            Assert.IsNotNull(notifyManager);
        }
Example #9
0
 public void RemoveEventHandler(string eventName, NotifyManager.StandardDelegate d)
 {
     if (m_eventMap.ContainsKey(eventName))
     {
         NotifyManager.RemoveEventHandler(eventName, d);
         m_eventMap[eventName] -= d;
     }
 }
Example #10
0
File: Basic.cs Project: radtek/EMIP
 public virtual MessageGroupCollection GetServerNotifyMessages(HttpContext context)
 {
     using (BPMConnection cn = new BPMConnection())
     {
         cn.WebOpen();
         return(NotifyManager.GetDefaultNotifyMessages(cn));
     }
 }
Example #11
0
File: Basic.cs Project: radtek/EMIP
 public virtual NotifyProviderInfoCollection GetNotifyProviders(HttpContext context)
 {
     using (BPMConnection cn = new BPMConnection())
     {
         cn.WebOpen();
         return(NotifyManager.GetProviders(cn));
     }
 }
Example #12
0
        // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
        //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
        //
        //}

        // OnStateExit is called when a transition ends and the state machine finishes evaluating this state
        override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            AnimatorInfo info = new AnimatorInfo();

            info.animator = animator;
            info.status   = AnimActionStatus.Exit;
            info.nameHash = stateInfo.shortNameHash;
            NotifyManager.SendNotify(NotifyType.OnAnimatorUpdate, info);
        }
Example #13
0
    // Use this for initialization
    void Start()
    {
        NotifyManager.Subscribe(this);

        _arm = transform.Find("arm");
        UpdateBalance(MyStatus.instance.economy);
        MyStatus.instance.economy.OnUpdate += UpdateBalance;
        Utilities.SetUIParentFit(GameObject.FindGameObjectWithTag("RootCanvas"), gameObject);
    }
Example #14
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new FoodTracker.App());

            NotifyManager.SetMainActivity(this);
        }
Example #15
0
        public void TestSend02()
        {
            NotifyManager notifyManager = NotifyManagerFactory.CreateNotifyManager01();
            string        type          = string.Empty;
            string        name          = string.Empty;
            object        body          = NotifyObjectFactory.CreateNotifyObject01();

            notifyManager.Send(type, name, body);
        }
Example #16
0
        public IHttpActionResult Submit(int siteId, int formId)
        {
            try
            {
                var request = Context.AuthenticatedRequest;

                var formInfo = FormManager.GetFormInfo(siteId, formId);
                if (formInfo == null)
                {
                    return(NotFound());
                }
                if (formInfo.IsClosed)
                {
                    return(BadRequest("对不起,表单已被禁用"));
                }

                if (formInfo.IsTimeout && (formInfo.TimeToStart > DateTime.Now || formInfo.TimeToEnd < DateTime.Now))
                {
                    return(BadRequest("对不起,表单只允许在规定的时间内提交"));
                }

                var logInfo = new LogInfo
                {
                    FormId  = formInfo.Id,
                    AddDate = DateTime.Now
                };

                var fieldInfoList = FieldManager.GetFieldInfoList(formInfo.Id);
                foreach (var fieldInfo in fieldInfoList)
                {
                    var value = request.GetPostString(fieldInfo.Title);
                    logInfo.Set(fieldInfo.Title, value);
                    if (FieldManager.IsExtra(fieldInfo))
                    {
                        foreach (var item in fieldInfo.Items)
                        {
                            var extrasId = FieldManager.GetExtrasId(fieldInfo.Id, item.Id);
                            var extras   = request.GetPostString(extrasId);
                            if (!string.IsNullOrEmpty(extras))
                            {
                                logInfo.Set(extrasId, extras);
                            }
                        }
                    }
                }

                logInfo.Id = LogManager.Repository.Insert(formInfo, logInfo);
                NotifyManager.SendNotify(formInfo, fieldInfoList, logInfo);

                return(Ok(logInfo));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
        public IHttpActionResult SearchNotifyByName(string Name = null, string StartTime = null, string EndTime = null)
        {
            string token    = HttpContext.Current.Request.Headers["token"];
            var    userInfo = JwtTools.DEcode(token);
            //调用usermanager.getuserinfo 获取用户信息
            var user   = UserManager.GetUserInfo(userInfo["name"]);
            var result = NotifyManager.GetNotifyByName(user.organizationID, Name, StartTime, EndTime);

            return(this.SendData(result));
        }
        /// <summary>
        /// EventHandler when user click "OK" on EditChartTitle form.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void ModifyTitles(object sender, EventArgs e)
        {
            string[] titles = m_View.GetTitles();
            m_titles[0] = titles[0];
            m_titles[1] = titles[1];
            m_titles[2] = titles[2];

            NotifyManager.GetInstance().Send(DataNotificaitonConst.ModifyTitles, m_View.ViewID, m_titles);
            m_View.DestroyView();
        }
Example #19
0
    void OnTriggerEnter(Collider other)
    {
        other.attachedRigidbody.gameObject.GetComponent <Entity>().heal(10.0f);

        Notify notify = new Notify(gameObject, m_player, "EatHeal");

        NotifyManager.SendNotify(notify);

        StartCoroutine("dissolveItem");
    }
Example #20
0
        public void TestSend03()
        {
            NotifyManager notifyManager = NotifyManagerFactory.CreateNotifyManager01();
            string        type          = string.Empty;
            string        name          = string.Empty;
            object        body          = ViewManagerFactory.CreateViewManager01();

            //Test Procedure Call
            notifyManager.Send(type, name, body);
        }
Example #21
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.name.Equals("player"))
        {
            Notify notify = new Notify(gameObject, m_player, "Hurt");
            NotifyManager.SendNotify(notify);

            //m_playeren.Damage(10);
            Destroy(gameObject);
        }
    }
Example #22
0
        public void PushMessage(string clientid, string[] channels, YZMessage message, bool broadcast)
        {
            BPMObjectNameCollection uids = new BPMObjectNameCollection();

            if (!broadcast)
            {
                uids = NotifyManager.GetNotifyUsers(message.resType, message.resId);
            }

            this.PushMessage(clientid, uids, channels, message, broadcast);
        }
Example #23
0
 protected void OnDestroy()
 {
     if (activeEventName.Length > 0)
     {
         NotifyManager.RemoveListener(activeEventName, this);
     }
     if (inactiveEventName.Length > 0)
     {
         NotifyManager.RemoveListener(inactiveEventName, this);
     }
 }
Example #24
0
 public void AddEventHandler(string eventName, NotifyManager.StandardDelegate d)
 {
     NotifyManager.AddEventHandler(eventName, d);
     if (!m_eventMap.ContainsKey(eventName))
     {
         m_eventMap[eventName] = d;
     }
     else
     {
         m_eventMap[eventName] += d;
     }
 }
Example #25
0
        public void SaveFormulaToGrpName(object sender, EventArgs e)
        {
            string grpName = m_View.GetConfigName();

            if (grpName == "")
            {
                m_View.ShowErrMsgNoCfgName();
                return;
            }
            NotifyManager.GetInstance().Send(DataNotificaitonConst.SaveFormulaToGroup, m_View.ViewID, grpName);
            m_View.DestroyView();
        }
 public void OnS2CNotify(NetPack pack)
 {
     //Debug.LogFormat("提示通知/对白框相关系统消息协议NotifyMsgID,CMD={0}, ", pack.CMD);
     switch ((NotifyMsgID)pack.CMD)
     {
     case NotifyMsgID.S2CNotifyNarmal:
         PB_NotifyNarmal mNotifyNarmal = PB_NotifyNarmal.Parser.ParseFrom(pack.BodyBuffer.Bytes);
         Debug.LogFormat("OnS2CNotify,普通悬浮提示:mNotifyNarmal={0}", mNotifyNarmal.ToString());
         NotifyManager mNotifyManager = FindObjectOfType <NotifyManager>();
         mNotifyManager.AddNotify(mNotifyNarmal.Msg);
         break;
     }
 }
Example #27
0
    protected void Start()
    {
        Init();
        if (activeEventName.Length > 0)
        {
            NotifyManager.AddListener(activeEventName, this);
        }

        if (inactiveEventName.Length > 0)
        {
            NotifyManager.AddListener(inactiveEventName, this);
        }
    }
Example #28
0
        public void TestSend01()
        {
            NotifyManager notifyManager = NotifyManagerFactory.CreateNotifyManager01();
            ObserverTest  observer1     = new ObserverTest();

            notifyManager.RegisterObserver(observer1);
            string type = string.Empty;
            string name = string.Empty;
            object body = NotifyManagerFactory.CreateNotifyManager01();

            //Test Procedure Call
            notifyManager.Send(type, name, body);
        }
Example #29
0
 public void ResetConnect()
 {
     ResponseHandleInvoker.Instance.ClearResponseQueue();
     ResponseHandleInvoker.Instance.IsPaused = false;
     HeartFPSManager.Instance.Clear();
     IpManager.InitServiceConfig();
     ServiceManager.DestorySockets();
     SingletonManager.Instance.Clear();
     NotifyManager.ClearEvents();
     ResetTaskInstance();
     RegisterEventHandler();
     UI.MainUI.EnegryColdWorkData.Instance.ResetEventHadels();
 }
Example #30
0
        public void LoadFormulaByGrpName(object sender, EventArgs e)  //todo: should we save the selected name in this controller?
        {
            string grpName = m_View.GetConfigName();

            if (grpName == "")
            {
                m_View.ShowErrMsgNoCfgName();
                return;
            }

            NotifyManager.GetInstance().Send(DataNotificaitonConst.SelectFormulaGroupToLoad, m_View.ViewID, grpName);
            m_View.DestroyView();
        }