Пример #1
0
    public void Awake()
    {
        instance  = this;
        activeTab = ActiveTab.Global;

        //SelectGlobalTab();
    }
Пример #2
0
        private void SetActiveTab(ActiveTab activeTab)
        {
            if (activeTab == ActiveTab.Inbox)
            {
                mailItemPages             = mailItemInboxPages;
                iconSelectedFolderHeader  = iconInboxFolder;
                labelSelectedFolderHeader = labelInboxFolder;
                this.activeTab            = activeTab;
            }
            else if (activeTab == ActiveTab.Outbox)
            {
                mailItemPages             = mailItemOutboxPages;
                iconSelectedFolderHeader  = iconOutboxFolder;
                labelSelectedFolderHeader = labelOutboxFolder;
                this.activeTab            = activeTab;
            }
            else if (activeTab == ActiveTab.Archive)
            {
                mailItemPages             = mailItemArchivePages;
                iconSelectedFolderHeader  = iconArchiveFolder;
                labelSelectedFolderHeader = labelArchiveFolder;
                this.activeTab            = activeTab;
            }

            SetLabelPageNumber();
        }
Пример #3
0
 public override void OnSelectionChange()
 {
     if (ActiveTab != null)
     {
         ActiveTab.OnSelectionChange();
     }
 }
Пример #4
0
 public override void Refresh()
 {
     if (ActiveTab != null)
     {
         ActiveTab.Refresh();
     }
 }
Пример #5
0
    void Start()
    {
        Localization();

        _controller = new ShopController(this);
        _controller.SendRequestRefreshGold();

        if (GameManager.Status == GameStatus.ShopHero)
        {
            shopRoot.SetActive(false);
            randomHeroRoot.gameObject.SetActive(true);
        }

        _activeTab = ActiveTab.None;

        _isBuyHero = true;
        setGoldSivler();

        if (BUYGOLD)
        {
            OnChangeTab(ActiveTab.Vault);
            BUYGOLD = false;
        }
        else
        {
            OnChangeTab(ActiveTab.Support);
        }
    }
Пример #6
0
        protected override void DrawChildren(IBatchedDrawingService drawingService)
        {
            for (var i = 0; i < this.Count; i++)
            {
                var child = this[i];
                if (ReferenceEquals(child, ActiveTab))
                {
                    continue;
                }
                if (DragState.DragActive && ReferenceEquals(child, DragState.DraggedTab))
                {
                    continue;
                }
                if (child.Visibility == Visibility.Visible)
                {
                    child.Draw(drawingService);
                }
            }

            if (ActiveTab?.Visibility == Visibility.Visible)
            {
                ActiveTab.Draw(drawingService);
            }
            if (DragState.DragActive && DragState.DraggedTab != ActiveTab)
            {
                DragState.DraggedTab?.Draw(drawingService);
            }
        }
Пример #7
0
        public DatabaseManagement(ActiveTab activeTab, Studio studio)
        {
            OwnerStudio = studio;

            InitializeComponent();

            this.Load += new EventHandler(DatabaseManagement_Load);
        }
Пример #8
0
 public override void OnDisable()
 {
     base.OnDisable();
     if (ActiveTab != null)
     {
         ActiveTab.OnDisable();
     }
 }
Пример #9
0
    private void OnChangeTab(ActiveTab tab, bool changed = false)
    {
        if (MessageBox.isShow)
        {
            return;
        }

        if (!changed)
        {
            if (tab == _activeTab)
            {
                return;
            }
        }

        reChargeRoot.SetActive(false);
        itemListRoot.SetActive(true);

        _activeTab = tab;
        switch (_activeTab)
        {
        case ActiveTab.Support:
            LoadItem(ActiveTab.Support);
            break;

        case ActiveTab.Jewel:
            LoadItem(ActiveTab.Jewel);
            break;

        case ActiveTab.Energy:
            LoadItem(ActiveTab.Energy);
            break;

        case ActiveTab.Vault:
            reChargeRoot.SetActive(true);
            Transform transformCard       = reChargeRoot.transform.FindChild("btnCard");
            Transform transformGooglePlay = reChargeRoot.transform.FindChild("btnIOS");

#if UNITY_ANDROID || UNITY_IOS
#else
            transformGooglePlay.gameObject.SetActive(false);
            transformCard.position = Vector3.zero;
#endif

            if (Global.language != Global.Language.VIETNAM)
            {
                transformCard.gameObject.SetActive(false);
                transformGooglePlay.position = Vector3.zero;
            }

            itemListRoot.SetActive(false);
            break;

        case ActiveTab.IOSReCharge:
            LoadItem(ActiveTab.IOSReCharge);
            break;
        }
    }
Пример #10
0
 public override void Refresh()
 {
     base.Refresh();
     if (ActiveTab != null)
     {
         ActiveTab.Refresh();
     }
     Repaint();
 }
Пример #11
0
        public override void Initialize(IApplicationManager applicationManager)
        {
            base.Initialize(applicationManager);

            HistoryTab.InitializeView(this);
            ChangesTab.InitializeView(this);
            BranchesTab.InitializeView(this);
            SettingsTab.InitializeView(this);
            ActiveTab.InitializeView(this);
        }
Пример #12
0
 private ManagementSwipeController GetSwipeController(ActiveTab tab)
 {
     if (swipeControllers.Count == 0)
     {
         swipeControllers.Add(ActiveTab.Accaunt, secretarySwipeController);
         swipeControllers.Add(ActiveTab.Garage, mechanicSwipeController);
         swipeControllers.Add(ActiveTab.Office, managerSwipeController);
     }
     return(swipeControllers[tab]);
 }
Пример #13
0
        void ActivateTab(TabPage tabPage)
        {
            var tabState = tabPage != null ? (TabPageController)tabPage.Tag : null;

            if (tabState != null && ActiveTab != tabState)
            {
                ActiveTab = tabState;
                RefreshTab(ActiveTab);
                ActiveTab.UpdateSelection();
            }
        }
Пример #14
0
        public override void OnRepositoryChanged(IRepository oldRepository)
        {
            base.OnRepositoryChanged(oldRepository);

            DetachHandlers(oldRepository);
            AttachHandlers(Repository);

            if (ActiveTab != null)
            {
                ActiveTab.OnRepositoryChanged(oldRepository);
            }
        }
Пример #15
0
    public void SelectGlobalTab()
    {
        activeTab = ActiveTab.Global;

        tabGlobal.text.color  = colorTabNormalText;
        tabGlobal.image.color = colorTabNormalBack;

        tabGame.text.color  = colorTabInactiveText;
        tabGame.image.color = colorTabInactiveBack;

        SetUIValues();
    }
Пример #16
0
        private void ShowActiveView()
        {
            if (Repository == null)
            {
                return;
            }

            if (ActiveTab != null)
            {
                ActiveTab.OnShow();
            }
            Refresh();
        }
Пример #17
0
		private void Application_Startup(object sender, StartupEventArgs e)
		{
			var processed = 0;
			ActiveTab = ActiveTab.Options;

			while (processed < e.Args.Count())
			{
				var arg = e.Args[processed];
				if (arg.StartsWith("/", StringComparison.InvariantCultureIgnoreCase))
				{
					if (arg.StartsWith("/IsDialog", StringComparison.InvariantCultureIgnoreCase))
					{
						IsDialog = true;
					}
					if (arg.StartsWith("/OptionLocation", StringComparison.InvariantCultureIgnoreCase))
					{
						var subProcessed = processed + 1;
						var howManyArgs = 0;
						for (int i = subProcessed; i < e.Args.Count(); i++)
						{
							if (e.Args[i].StartsWith("/", StringComparison.InvariantCultureIgnoreCase))
							{
								break;
							}
							howManyArgs++;
						}

						for (int i = subProcessed; i < subProcessed + howManyArgs; i++)
						{
							if (!string.IsNullOrEmpty(e.Args[i]) )
							{
								if (!e.Args[i].Equals("=", StringComparison.InvariantCultureIgnoreCase) )
								{
									OptionLocation = string.Format(CultureInfo.CurrentCulture, "{0}\\{1}", OptionLocation, e.Args[i]);
								}
							}
						}
						processed = subProcessed + howManyArgs;
					}
					if (arg.StartsWith("/Licensing", StringComparison.InvariantCultureIgnoreCase))
					{
						ActiveTab = ActiveTab.Licensing;
					}
					if (arg.StartsWith("/RenderingSet", StringComparison.InvariantCultureIgnoreCase))
					{
						ActiveTab = ActiveTab.RenderingSet;
					}
				}
				processed++;
			}
		}
Пример #18
0
    public void SelectGameTab()
    {
        //if (!PlayBoundsManager.instance.IsRunningAnApp()) return;

        activeTab = ActiveTab.Game;

        tabGlobal.text.color  = colorTabInactiveText;
        tabGlobal.image.color = colorTabInactiveBack;

        tabGame.text.color  = colorTabNormalText;
        tabGame.image.color = colorTabNormalBack;

        SetUIValues();
    }
Пример #19
0
		public void MakeTabActive(ActiveTab activeTab)
		{
			switch (activeTab)
			{
				case ActiveTab.Licensing:
					this.licensingTab.IsSelected = true;
					break;
				case ActiveTab.Options:
					this.optionsTab.IsSelected = true;
					break;
				case ActiveTab.RenderingSet:
					this.renderingSetTab.IsSelected = true;
					break;
			}
		}
Пример #20
0
        public override void OnEnable()
        {
            base.OnEnable();

#if DEVELOPER_BUILD
            Selection.activeObject = this;
#endif

            // Set window title
            titleContent = new GUIContent(Title, Styles.SmallLogo);

            if (ActiveTab != null)
            {
                ActiveTab.OnEnable();
            }
        }
Пример #21
0
        public override void OnGUI()
        {
            base.OnGUI();

            if (Repository != null)
            {
                DoHeaderGUI();
            }

            DoToolbarGUI();

            // GUI for the active tab
            if (ActiveTab != null)
            {
                ActiveTab.OnGUI();
            }
        }
Пример #22
0
    private void LoadItem(ActiveTab type)
    {
        ClearOldItems();
        List <GameObj> shopItems;

        if (type == ActiveTab.Support)
        {
            shopItems = GameManager.ChargeShop.Where(p => ((ShopItem)p).ItemKind == ItemKind.Support).ToList();
        }
        else if (type == ActiveTab.Jewel)
        {
            shopItems = GameManager.ChargeShop.Where(p => ((ShopItem)p).ItemKind == ItemKind.Material).ToList();
        }
        else if (type == ActiveTab.Energy)
        {
            shopItems = GameManager.ChargeShop.Where(p => ((ShopItem)p).ItemKind == ItemKind.Consume).ToList();
        }
        else if (type == ActiveTab.IOSReCharge)
        {
            shopItems = GameManager.ChargeShop.Where(p => ((ShopItem)p).ItemKind == ItemKind.Gold || ((ShopItem)p).ItemKind == ItemKind.Silver).ToList();
        }
        else
        {
            shopItems = GameManager.ChargeShop.ToList();
        }

        int i = 0;

        foreach (ShopItem shopItem in shopItems)
        {
            GameObject go = NGUITools.AddChild(itemRoot, itemPrefab);
            _itemsShowing.Add(go);
            UIShopSlotItemManger itemManager = go.GetComponent <UIShopSlotItemManger>();
            itemManager.SetGameItem(shopItem, this);

            if (shopItem.UserLevel > GameManager.GameUser.Base.Level)
            {
                itemManager.OnDisable();
            }

            i++;
        }
        itemRoot.transform.parent.GetComponent <UIScrollView>().ResetPosition();
        itemRoot.GetComponent <UIGrid>().Reposition();
    }
 protected override void GetAttributes()
 {
     attrs.Clear();
     attrs.Add("CityId", CityId.ToString());
     attrs.Add("ProvinceId", ProvinceId.ToString());
     attrs.Add("IndoorTemperature", IndoorTemperature.ToString());
     attrs.Add("GraphScale", GraphScale.ToString());
     attrs.Add("ActiveTab", ActiveTab.ToString());
     attrs.Add("buildingwidth", BuildingOutlineWidth.ToString());
     attrs.Add("blockscale", BlockScale.ToString());
     attrs.Add("pipeLineScale", PipeLineScale.ToString());
     attrs.Add("elecprice", ElecPrice.ToString());
     attrs.Add("gasprice", GasPrice.ToString());
     if (rasterImageID.IsNull == false)
     {
         attrs.Add("rasterImage", rasterImageID.Handle.ToString());
     }
 }
Пример #24
0
        public override void OnDataUpdate()
        {
            base.OnDataUpdate();

            string repoRemote = null;

            if (MaybeUpdateData(out repoRemote))
            {
                repoBranchContent = new GUIContent(repoBranch, Window_RepoBranchTooltip);
                if (repoUrl != null)
                {
                    repoUrlContent = new GUIContent(repoUrl, string.Format(Window_RepoUrlTooltip, repoRemote));
                }
                else
                {
                    repoUrlContent = new GUIContent(repoUrl, Window_RepoNoUrlTooltip);
                }
            }

            if (ActiveTab != null)
            {
                ActiveTab.OnDataUpdate();
            }
        }
Пример #25
0
 private void OnPrevPageRequested(object sender, EventArgs e)
 {
     ActiveTab.OnRequestPreviousPage();
 }
Пример #26
0
 private void SidebarTabs_SelectedIndexChanged(object sender, EventArgs e)
 {
     this.ActiveTab = (ActiveTab)(sender as TabControl).SelectedIndex;
 }
Пример #27
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            //set view to entire cart or to approved items
            switch (this.Scope)
            {
                case CouponScope.EntireBasket:
                    mvScope.SetActiveView(vwEntireCart);
                    break;
                case CouponScope.AllApprovedItems:
                case CouponScope.Exclude:
                case CouponScope.Include:
                case CouponScope.LeastExpensiveItem:
                case CouponScope.MostExpensiveItem:
                    mvScope.SetActiveView(vwApprovedItems);
                    //set view to include or exclude
                    _ActiveTab = lbExclude.CssClass == "selected" ? ActiveTab.Exclude : ActiveTab.Include;
                    switch (_ActiveTab)
                    {
                        case ActiveTab.Include:
                            mvIncludeExclude.SetActiveView(vwInclude);
                            break;
                        case ActiveTab.Exclude:
                            mvIncludeExclude.SetActiveView(vwExclude);
                            break;
                    }
                    break;
            }

            //set localized strings
            this.SetLocalizedControlText();
        }
Пример #28
0
 protected void ItemsData_Click(object sender, CommandEventArgs e)
 {
     switch (e.CommandName)
     {
         case "Include":
             lbInclude.CssClass = "selected";
             lbExclude.CssClass = String.Empty;
             _ActiveTab = ActiveTab.Include;
             break;
         case "Exclude":
             lbInclude.CssClass = String.Empty;
             lbExclude.CssClass = "selected";
             _ActiveTab = ActiveTab.Exclude;
             break;
     }
 }
Пример #29
0
 /// <summary>
 /// Returns a <see cref="System.String" /> that represents this instance.
 /// </summary>
 /// <returns>
 /// A <see cref="System.String" /> that represents this instance.
 /// </returns>
 public override string ToString()
 {
     return(ActivePane == Pane.Master ? ActiveTab.ToString(CultureInfo.InvariantCulture) : ActivePane.ToString());
 }
Пример #30
0
        protected override async Task ExecuteAsync(CancellationToken stopToken)
        {
            await Task.Delay(1);

            var tabRefreshInterval = 30000;
            var MainInterval       = 60000;

            Console.WriteLine("------------------------------------");
            Console.WriteLine("--------Starting main cycle---------");
            Console.WriteLine("------------------------------------");
            try
            {
                _ = Task.Run(async() =>
                {
                    Console.WriteLine("Running...");
                    while (!stopToken.IsCancellationRequested)
                    {
                        try
                        {
                            var tokenholders = await NeblioTransactionHelpers.GetTokenOwnersList(NFTHelpers.TokenId);
                            var i            = 0;

                            foreach (var th in tokenholders)
                            {
                                Console.WriteLine($"Start Loading {i} VENFT token owner of total {tokenholders.Count} owners.");

                                try
                                {
                                    if (MainDataContext.VENFTOwnersTabs.TryGetValue(th.Address, out var ownerTab))
                                    {
                                        //if (ownerTab.MaxLoadedNFTItems != 100) ownerTab.MaxLoadedNFTItems = 100;
                                        if (!ownerTab.IsRefreshingRunning)
                                        {
                                            await ownerTab.StartRefreshing(tabRefreshInterval);
                                        }
                                    }
                                    else
                                    {
                                        Console.WriteLine("Adding New Address To the Tabs: " + th.Address);
                                        var tab          = new ActiveTab(th.Address);
                                        tab.NFTsChanged += ((sender, e) =>
                                        {
                                            try
                                            {
                                                if (MainDataContext.VENFTOwnersTabs.TryGetValue(e, out var ownerTab))
                                                {
                                                    ownerTab.NFTs.ForEach(n =>
                                                    {
                                                        if (n.Type != NFTTypes.Payment && n.PriceActive)
                                                        {
                                                            if (!MainDataContext.PublicSellNFTs.TryGetValue($"{n.Utxo}:{n.UtxoIndex}", out var nft))
                                                            {
                                                                n.TxDetails = null;
                                                                MainDataContext.PublicSellNFTs.TryAdd($"{n.Utxo}:{n.UtxoIndex}", n);
                                                            }
                                                        }
                                                    });
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                Console.WriteLine($"Cannot load new NFTs of {e} token owner. " + ex.Message);
                                            }
                                        });

                                        MainDataContext.VENFTOwnersTabs.TryAdd(th.Address, tab);
                                        if (!tab.IsRefreshingRunning)
                                        {
                                            await tab.StartRefreshing(tabRefreshInterval);
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine($"Cannot start loading tab {th}. " + ex.Message);
                                }
                                i++;
                            }

                            lock (_lock)
                            {
                                MainDataContext.PublicSellNFTsList.Clear();
                                MainDataContext.PublicSellNFTsList = MainDataContext.PublicSellNFTs.Values.ToList()?.OrderByDescending(n => n.Time).ToList();
                            }

                            Console.WriteLine("All VENFT Token Owners Loaded.");
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine("Cannot refresh VENFT Owners");
                        }

                        await Task.Delay(MainInterval);
                    }
                });
            }
            catch (Exception ex)
            {
                //log.Error("Fatal error in main loop. " + ex.Message);
                lifetime.StopApplication();
            }
        }
Пример #31
0
 private string GetItems()
 {
     return(ActiveTab.Export());
 }
Пример #32
0
        public override void Setup(ViewData data)
        {
            base.Setup(data);
            this.managerId = (int)data.UserData;

            reportsAlert.Setup(managerId);
            mechanicsAlert.Setup(managerId);

            GameEvents.OnTutorialEvent(new TutorialEventData(TutorialEventName.ManagementViewOpenedForManager, managerId));

            ActivateSwipeController();

            officeToggle.SetListener((isOn) => {
                if (isOn)
                {
                    DeactivateAndChangeManager();
                    activeTab = ActiveTab.Office;
                    ActivateSwipeController();
                    Services.GetService <ISoundService>().PlayOneShot(SoundName.click);
                    UpdateLeftRightManagersButton(managerId);
                }

                OfficeText.color = isOn ? EnableTabColor : DisableTabColor;
            });

            garageToggle.SetListener((isOn) => {
                if (isOn)
                {
                    if (Planets.IsOpened(PlanetConst.MARS_ID))
                    {
                        DeactivateAndChangeManager();
                        garageViewUnavailable.Deactivate();
                        activeTab = ActiveTab.Garage;
                        ActivateSwipeController();
                        GameEvents.OnTutorialEvent(new TutorialEventData(TutorialEventName.MechanicOpened));
                    }
                    else
                    {
                        DeactivateAndChangeManager();
                        activeTab = ActiveTab.Garage;
                        garageViewUnavailable.Activate();
                    }
                    garageIconImage.overrideSprite = activeGarageIconSprite;
                    Services.GetService <ISoundService>().PlayOneShot(SoundName.click);
                    UpdateLeftRightManagersButton(managerId);
                }
                else
                {
                    garageIconImage.overrideSprite = notActiveGarageIconSprite;
                    garageViewUnavailable.Deactivate();
                }

                GarageText.color = isOn ? EnableTabColor : DisableTabColor;
            });

            reportsToggle.SetListener((isOn) => {
                if (isOn)
                {
                    IPlanetService planetService = Services.GetService <IPlanetService>();
                    if (planetService.IsOpened(PlanetConst.MOON_ID))
                    {
                        DeactivateAndChangeManager();
                        reportsViewUnavailable.Deactivate();
                        activeTab = ActiveTab.Accaunt;
                        ActivateSwipeController();
                        GameEvents.OnTutorialEvent(new TutorialEventData(TutorialEventName.SecretariesOpened));
                    }
                    else
                    {
                        DeactivateAndChangeManager();
                        activeTab = ActiveTab.Accaunt;
                        reportsViewUnavailable.Activate();
                    }



                    accountingIconImage.overrideSprite = activeAccountingIconSprite;
                    Services.GetService <ISoundService>().PlayOneShot(SoundName.click);
                    UpdateLeftRightManagersButton(managerId);
                }
                else
                {
                    reportsViewUnavailable.Deactivate();
                    accountingIconImage.overrideSprite = notActiveAccountingIconSprite;
                }

                AccauntText.color = isOn ? EnableTabColor : DisableTabColor;
            });

            closeButton.SetListener(() => {
                Services.ViewService.Remove(ViewType.ManagementView, 0.2f);
                Services.GetService <ISoundService>().PlayOneShot(SoundName.click);
            });

            garageViewUnavailable.Deactivate();
            reportsViewUnavailable.Deactivate();

            UpdateView(managerId);
            UpdateLeftRightManagersButton(managerId);
            leftManagerButton.SetListener(() => {
                var swipeControl = GetSwipeController(activeTab);
                if (!swipeControl.IsTransitionStarted)
                {
                    swipeControl.MakeTransitionProgrammatically(SwipeResultAction.MoveToRight);
                    leftManagerButton.SetInteractable(false);
                    rightManagerButton.SetInteractable(false);
                    Sounds.PlayOneShot(SoundName.panel_slide);
                }
            });
            rightManagerButton.SetListener(() => {
                var swipeControl = GetSwipeController(activeTab);
                if (!swipeControl.IsTransitionStarted)
                {
                    swipeControl.MakeTransitionProgrammatically(SwipeResultAction.MoveToLeft);
                    leftManagerButton.SetInteractable(false);
                    rightManagerButton.SetInteractable(false);
                    Sounds.PlayOneShot(SoundName.panel_slide);
                }
            });
        }
Пример #33
0
 private void OnNextPageRequested(object sender, EventArgs e)
 {
     ActiveTab.OnRequestNextPage();
 }