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()
         });
     }
 }
Пример #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);
    }
Пример #3
0
 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);
     }
 }
Пример #4
0
        public static void Send(INotice notice, bool useSSL)
        {
            var uri  = _GetUri(useSSL);
            var json = JsonConvert.SerializeObject(notice, _settings);

            new WebClient().UploadString(uri, json);
        }
Пример #5
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);
    }
Пример #6
0
 protected void SendToMediator(INotice notice)
 {
     if (_mediator != null)
     {
         _mediator.HandleNotice(notice);
     }
 }
Пример #7
0
        public static void Send(INotice notice, bool useSSL)
        {
            var uri = _GetUri(useSSL);
            var json = JsonConvert.SerializeObject(notice, _settings);

            new WebClient().UploadString(uri, json);
        }
Пример #8
0
 public void FinishNotice(INotice notice)
 {
     this.SendNotice(Index, SubCommand_Close);
     if (notice != null)
     {
         notice.Finish();
     }
 }
Пример #9
0
        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));
        }
Пример #10
0
 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;
 }
Пример #12
0
        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));
        }
Пример #13
0
 /// <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);
     }
 }
Пример #14
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);
 }
Пример #15
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);
 }
Пример #16
0
 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
 }
Пример #17
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);
 }
Пример #18
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);
 }
Пример #19
0
 public void FinishNotice(INotice notice)
 {
     this.SendNotice(Index, Command_Close);
     Facade.ChangeScene("AMainScene", (token) =>
     {
         if (notice != null)
         {
             notice.Finish();
         }
     });
 }
Пример #20
0
        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));
        }
Пример #21
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);
 }
Пример #22
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);
 }
Пример #23
0
    public override void Execute(INotice notice)
    {
        switch (notice.GetType())
        {
        case Monitor_Closed:
            WindowStackManager.ins.OnWindowClosed(notice.GetBody()[0].ToString());
            break;
        }

        base.Execute(notice);
    }
Пример #24
0
        public void NotifyModularAndRelease(int noticeName, INoticeBase <int> param = default, bool isRelease = true)
        {
            INotice notice = NotifyModular(noticeName, param) as INotice;

            if (isRelease)
            {
                notice?.ToPool();
            }
            else
            {
            }
        }
Пример #25
0
 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;
 }
Пример #26
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));
        }
Пример #27
0
    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();
    }
Пример #28
0
 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();
     }
 }
Пример #29
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);
    }
Пример #30
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);
    }
Пример #31
0
 /// <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();
             }
         }
     }
 }
Пример #32
0
 private void putTaskBarLater(INotice notice)
 {
     notice.Click += TaskBar_Click;
     panelNotice.Children.Add(notice);
     gridNullth.Visibility = Visibility.Collapsed;
 }
Пример #33
0
		/// <summary>
		///   建構子
		/// </summary>
		/// <param name="dataSource">報價元件名稱</param>
		/// <param name="notice">公告內容</param>
		public QuoteNoticeEvent(string dataSource, INotice notice) {
			__sDataSource = dataSource;
			__cNotice = notice;
		}
Пример #34
0
 public static void Send(INotice notice)
 {
     Send(notice, true);
 }
Пример #35
0
 public NoticeFactory() {
     iNotice = new Notices();
 }