コード例 #1
0
        /// <summary>
        /// Shows the next notification that needs to be displayed.
        /// </summary>
        protected void ShowNextNotification()
        {
            if (MenuData.Notifications == null)
            {
                return;
            }

            //
            // Get the current time and the last notification date we saw.
            //
            var now = DateTime.Now;

            if (!DateTime.TryParse(NSUserDefaults.StandardUserDefaults.StringForKey("Crex.LastSeenNotification"), out DateTime lastSeenNotification))
            {
                lastSeenNotification = DateTime.MinValue;
            }

            //
            // Find the next notification.
            //
            MenuData.Notifications.ForEach(n => n.StartDateTime = n.StartDateTime.ToLocalTime());
            var notification = MenuData.Notifications
                               .Where(n => n.StartDateTime > lastSeenNotification && n.StartDateTime <= now)
                               .OrderBy(n => n.StartDateTime)
                               .FirstOrDefault();

            //
            // If we have another notification, show it.
            //
            if (notification != null)
            {
                NotificationViewController.ShowNotification(notification);
            }
        }
コード例 #2
0
    void OnEnable()
    {
        if (product == null)
        {
            gameObject.SetActive(false);
            NotificationViewController.ShowNotification(Localization.Localize(StringKey.Msg_FindProductFail));
            return;
        }
        cover.SetActive(true);
        scrollCamera.SetActive(true);
        leftButton.SetActive(false);
        rightButton.SetActive(true);
        modelPrefab = Resources.Load("Prefabs/ProductPrefab") as GameObject;
        model       = Instantiate(modelPrefab) as GameObject;
        model.transform.position = new Vector3(0, 1000, 0);

        labelPrefab = Resources.Load("Prefabs/ProductLabel") as GameObject;

        SingleModelController smc = model.GetComponent <SingleModelController>();

        smc.beforeMoveAway = BeforeMoveAway;
        smc.beforeMoveBack = BeforeMoveBack;
        smc.afterMoveAway  = AfterMoveAway;
        smc.afterMoveBack  = AfterMoveBack;

        ResizeViewport();
        tableComp.Reposition();
    }
コード例 #3
0
 private void ClearCache(GameObject go)
 {
     Debug.Log("ClearCache");
     if (Caching.CleanCache())
     {
         cacheSpace.GetComponent <UILabel>().text = GetCacheSpace();
     }
     NotificationViewController.ShowNotification(Localization.Localize(StringKey.Msg_ClearCacheSuccess));
 }
コード例 #4
0
        /// <summary>
        /// 通知所以人
        /// </summary>
        /// <returns></returns>
        public async static Task SendNotificationAll()
        {
            if (_hubInfo.Count > 0)
            {
                NotificationViewController controllerNotifciationView = new NotificationViewController(HubEntityContract._notificationContract, HubEntityContract._msgNotificationContract, HubEntityContract._notificationQASystemContract);
                foreach (var item in _hubInfo)
                {
                    var client  = AllClients.Client(item.connectionId);
                    int AdminId = item.AdminId.CastTo <int>();
                    var data    = await controllerNotifciationView.getLastNewNotification(3, AdminId);

                    client.GetNotification(data.Data);
                }
            }
        }
コード例 #5
0
        public async static Task SendNotification(params int[] AdminIds)
        {
            if (AdminIds.IsNotNullThis())
            {
                NotificationViewController controllerNotifciationView = new NotificationViewController(HubEntityContract._notificationContract, HubEntityContract._msgNotificationContract, HubEntityContract._notificationQASystemContract);
                foreach (var curDevice in GetCurAdminDeviceIds(AdminIds))
                {
                    var client  = AllClients.Client(curDevice.connectionId);
                    int AdminId = curDevice.AdminId.CastTo <int>();
                    var data    = await controllerNotifciationView.getLastNewNotification(3, AdminId);

                    client.GetNotification(data.Data);
                }
            }
        }
コード例 #6
0
 private void NotifyProgress(float progress)
 {
     Debug.Log("Loading progress is " + progress);
     if (progress == 1.0f)
     {
         LoadViewController.HideLoadProgress(OnFinishLoad);
     }
     else if (progress == -1.0f)
     {
         NotificationViewController.ShowNotification(Localization.Localize(StringKey.Msg_LoadSceneFail));
     }
     else
     {
         LoadViewController.NotifyProgress(progress);
     }
 }
コード例 #7
0
        /// <summary>
        /// The view has loaded, now we can create any child views.
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            BackgroundImageView = new UIImageView(new CGRect(0, 0, 1920, 1080));
            View.AddSubview(BackgroundImageView);

            MenuBarView = new Views.MenuBarView(new CGRect(0, 960, 1920, 120));
            MenuBarView.ButtonClicked += MenuBarView_ButtonClicked;
            View.AddSubview(MenuBarView);

            //
            // Setup the notification view controller.
            //
            NotificationViewController = new NotificationViewController();
            AddChildViewController(NotificationViewController);
            View.AddSubview(NotificationViewController.View);
            NotificationViewController.DidMoveToParentViewController(this);
            NotificationViewController.NotificationWasDismissed += (sender, arg) =>
            {
                View.SetNeedsFocusUpdate();

                Task.Run(async() =>
                {
                    //
                    // Slight pause to let the focus animations settle.
                    //
                    await Task.Delay(500);

                    InvokeOnMainThread(ShowNextNotification);
                });
            };
            NotificationViewController.FocusGuide.PreferredFocusEnvironments = new[] { MenuBarView };

            //
            // Setup the focus guide for when the users moves up from the menu bar.
            //
            var menuBarUpFocusGuide = new UIFocusGuide();

            View.AddLayoutGuide(menuBarUpFocusGuide);
            menuBarUpFocusGuide.LeftAnchor.ConstraintEqualTo(MenuBarView.LeftAnchor).Active    = true;
            menuBarUpFocusGuide.RightAnchor.ConstraintEqualTo(MenuBarView.RightAnchor).Active  = true;
            menuBarUpFocusGuide.TopAnchor.ConstraintEqualTo(MenuBarView.TopAnchor, -64).Active = true;
            menuBarUpFocusGuide.BottomAnchor.ConstraintEqualTo(MenuBarView.TopAnchor).Active   = true;
            menuBarUpFocusGuide.PreferredFocusEnvironments = new[] { NotificationViewController.View };
        }
コード例 #8
0
 void Awake()
 {
     nvc   = this;
     label = notificationView.transform.Find("Label").gameObject.GetComponent <UILabel>();
 }