public void GetNoticeData(int type, string scene) { try { INotice notice = IApollo.Instance.GetService(5) as INotice; ApolloNoticeInfo apolloNoticeInfo = new ApolloNoticeInfo(); notice.GetNoticeData((APOLLO_NOTICETYPE)type, scene, ref apolloNoticeInfo); for (int i = 0; i < apolloNoticeInfo.DataList.get_Count(); i++) { ApolloNoticeData apolloNoticeData = apolloNoticeInfo.DataList.get_Item(i); } NoticeSys.NOTICE_STATE noticeState = NoticeSys.NOTICE_STATE.LOGIN_Before; if (scene == "1") { noticeState = NoticeSys.NOTICE_STATE.LOGIN_Before; } else if (scene == "2") { noticeState = NoticeSys.NOTICE_STATE.LOGIN_After; } MonoSingleton <NoticeSys> .GetInstance().OnOpenForm(apolloNoticeInfo, noticeState); } catch (Exception ex) { DebugHelper.Assert(false, "Error In GetNoticeData, {0}", new object[] { ex.get_Message() }); } }
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); }
public void GetNoticeData(int type, string scene) { try { INotice service = IApollo.Instance.GetService(5) as INotice; ApolloNoticeInfo info = new ApolloNoticeInfo(); service.GetNoticeData((APOLLO_NOTICETYPE)type, scene, ref info); for (int i = 0; i < info.DataList.Count; i++) { ApolloNoticeData data = info.DataList[i]; } NoticeSys.NOTICE_STATE noticeState = NoticeSys.NOTICE_STATE.LOGIN_Before; if (scene == "1") { noticeState = NoticeSys.NOTICE_STATE.LOGIN_Before; } else if (scene == "2") { noticeState = NoticeSys.NOTICE_STATE.LOGIN_After; } MonoSingleton <NoticeSys> .GetInstance().OnOpenForm(info, noticeState); } catch (Exception exception) { object[] inParameters = new object[] { exception.Message }; DebugHelper.Assert(false, "Error In GetNoticeData, {0}", inParameters); } }
public static void Send(INotice notice, bool useSSL) { var uri = _GetUri(useSSL); var json = JsonConvert.SerializeObject(notice, _settings); new WebClient().UploadString(uri, json); }
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); }
protected void SendToMediator(INotice notice) { if (_mediator != null) { _mediator.HandleNotice(notice); } }
public void FinishNotice(INotice notice) { this.SendNotice(Index, SubCommand_Close); if (notice != null) { notice.Finish(); } }
public Task <HttpResponseMessage> SendAsync(INotice notice, bool useSSL) { var uri = useSSL ? _sslUri : _uri; var json = JsonConvert.SerializeObject(notice, _settings); var content = new StringContent(json, Encoding.UTF8, "application/json"); return(_HttpClient.PostAsync(uri, content)); }
public void Send(INotice notice, bool useSSL, Action <Exception> onException) => Task.Run(async() => { try { await SendAsync(notice, useSSL); } catch (Exception ex) { onException(ex); } });
public DataSensorsHandlerWrapper(IIntegrationEventHandler <DataSensorsAddedIntegrationEvent <DataSensorsAddedContent> > dataHandler, INotice notice, ILogger <DataSensorsHandlerWrapper> logger) { _dataHandler = dataHandler; _notice = notice; _logger = logger; }
public static async Task <HttpResponseMessage> SendAsync(INotice notice, bool useSSL) { var uri = _GetUri(useSSL); var json = JsonConvert.SerializeObject(notice, _settings); var content = new StringContent(json); return(await new HttpClient().PostAsync(uri, content)); }
/// <summary> /// Override in a derived class to control how the tasks are awaited. By default the implementation is a foreach and await of each handler /// </summary> /// <param name="handlers">Enumerable of tasks representing invoking each notice handler</param> /// <param name="notice">The notice being published</param> /// <param name="cancellationToken">The cancellation token</param> /// <returns>A task representing invoking all handlers</returns> protected virtual async Task PublishAsync(IEnumerable <Func <INotice, CancellationToken, Task> > handlers, INotice notice, CancellationToken cancellationToken) { foreach (var handler in handlers) { await handler(notice, cancellationToken).ConfigureAwait(false); } }
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); }
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); }
private void OnFinished() { #region 测试服务容器 FWServer server = FWConsts.SERVER_FW.GetServer <FWServer>(); INotice notice = server.Resolve <INotice>("Notice") as INotice; Debug.Log(notice.Name); notice = server.Resolve <INotice>("GameNotice") as INotice; Debug.Log(notice.Name); #endregion }
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); }
public override void HandleNotice(INotice notice) { switch (notice.GetType()) { case Command.Command_Show: OtherVo vo = notice.GetBody <OtherVo>(); SetViewObj(vo); break; } base.HandleNotice(notice); }
public void FinishNotice(INotice notice) { this.SendNotice(Index, Command_Close); Facade.ChangeScene("AMainScene", (token) => { if (notice != null) { notice.Finish(); } }); }
public override Task HandleAsync(INotice notice, IServiceProvider serviceProvider, CancellationToken cancellationToken, Func <IEnumerable <Func <INotice, CancellationToken, Task> >, INotice, CancellationToken, Task> publish) { var handlers = ((IEnumerable <INoticeHandler <TNotice> >)serviceProvider .GetService(typeof(IEnumerable <INoticeHandler <TNotice> >))) .Select(x => new Func <INotice, CancellationToken, Task>((n, c) => x.HandleAsync((TNotice)n, c))); return(publish(handlers, notice, cancellationToken)); }
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); }
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); }
public override void Execute(INotice notice) { switch (notice.GetType()) { case Monitor_Closed: WindowStackManager.ins.OnWindowClosed(notice.GetBody()[0].ToString()); break; } base.Execute(notice); }
public void NotifyModularAndRelease(int noticeName, INoticeBase <int> param = default, bool isRelease = true) { INotice notice = NotifyModular(noticeName, param) as INotice; if (isRelease) { notice?.ToPool(); } else { } }
public AdminController(IUser iuser, ISetting isetting, ILog ilog, IPrice iprice, INotice inotice, IRequestMoney irequestmoney, IMoney imoney, IHelp ihelp, IUserAccount iuseraccount) { this.iuser = iuser; this.isetting = isetting; this.ilog = ilog; this.iprice = iprice; this.inotice = inotice; this.irequestmoney = irequestmoney; this.imoney = imoney; this.ihelp = ihelp; this.iuseraccount = iuseraccount; }
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)); }
public Notice() { //初始化ASP.NET内置对象 Response = System.Web.HttpContext.Current.Response; Request = System.Web.HttpContext.Current.Request; Server = System.Web.HttpContext.Current.Server; Session = System.Web.HttpContext.Current.Session; Application = System.Web.HttpContext.Current.Application; tools = ToolsFactory.CreateTools(); MyBLL = NoticeFactory.CreateNotice(); noticeCate = new NoticeCate(); }
void ta_Completed(object sender, EventArgs e) { if (CurrentNotice != null) { var index = CurrentNotice.Index++; if (index >= Items.Count()) { index = 0; } CurrentNotice = Items.ElementAt(index); //CurrentNotice Content = CurrentNotice.Content; Animation(); } }
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); }
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); }
/// <summary> /// 检测世界交换物体的事件 /// </summary> private void CheckWorldEvents() { if (mWorldEventNotices.Count > 0) { mItemNotice = mWorldEventNotices.Dequeue(); if (mEventItems.Count > 0) { mEventItem = mEventItems.Dequeue(); if (IsEventItemValid()) { mEventItem.Dispatch(mItemNotice);//派发世界物体消息 mItemNotice.ToPool(); } } } }
private void putTaskBarLater(INotice notice) { notice.Click += TaskBar_Click; panelNotice.Children.Add(notice); gridNullth.Visibility = Visibility.Collapsed; }
/// <summary> /// 建構子 /// </summary> /// <param name="dataSource">報價元件名稱</param> /// <param name="notice">公告內容</param> public QuoteNoticeEvent(string dataSource, INotice notice) { __sDataSource = dataSource; __cNotice = notice; }
public static void Send(INotice notice) { Send(notice, true); }
public NoticeFactory() { iNotice = new Notices(); }