public void Awake() { instance = this; activeTab = ActiveTab.Global; //SelectGlobalTab(); }
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(); }
public override void OnSelectionChange() { if (ActiveTab != null) { ActiveTab.OnSelectionChange(); } }
public override void Refresh() { if (ActiveTab != null) { ActiveTab.Refresh(); } }
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); } }
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); } }
public DatabaseManagement(ActiveTab activeTab, Studio studio) { OwnerStudio = studio; InitializeComponent(); this.Load += new EventHandler(DatabaseManagement_Load); }
public override void OnDisable() { base.OnDisable(); if (ActiveTab != null) { ActiveTab.OnDisable(); } }
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; } }
public override void Refresh() { base.Refresh(); if (ActiveTab != null) { ActiveTab.Refresh(); } Repaint(); }
public override void Initialize(IApplicationManager applicationManager) { base.Initialize(applicationManager); HistoryTab.InitializeView(this); ChangesTab.InitializeView(this); BranchesTab.InitializeView(this); SettingsTab.InitializeView(this); ActiveTab.InitializeView(this); }
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]); }
void ActivateTab(TabPage tabPage) { var tabState = tabPage != null ? (TabPageController)tabPage.Tag : null; if (tabState != null && ActiveTab != tabState) { ActiveTab = tabState; RefreshTab(ActiveTab); ActiveTab.UpdateSelection(); } }
public override void OnRepositoryChanged(IRepository oldRepository) { base.OnRepositoryChanged(oldRepository); DetachHandlers(oldRepository); AttachHandlers(Repository); if (ActiveTab != null) { ActiveTab.OnRepositoryChanged(oldRepository); } }
public void SelectGlobalTab() { activeTab = ActiveTab.Global; tabGlobal.text.color = colorTabNormalText; tabGlobal.image.color = colorTabNormalBack; tabGame.text.color = colorTabInactiveText; tabGame.image.color = colorTabInactiveBack; SetUIValues(); }
private void ShowActiveView() { if (Repository == null) { return; } if (ActiveTab != null) { ActiveTab.OnShow(); } Refresh(); }
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++; } }
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(); }
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; } }
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(); } }
public override void OnGUI() { base.OnGUI(); if (Repository != null) { DoHeaderGUI(); } DoToolbarGUI(); // GUI for the active tab if (ActiveTab != null) { ActiveTab.OnGUI(); } }
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()); } }
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(); } }
private void OnPrevPageRequested(object sender, EventArgs e) { ActiveTab.OnRequestPreviousPage(); }
private void SidebarTabs_SelectedIndexChanged(object sender, EventArgs e) { this.ActiveTab = (ActiveTab)(sender as TabControl).SelectedIndex; }
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(); }
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; } }
/// <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()); }
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(); } }
private string GetItems() { return(ActiveTab.Export()); }
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); } }); }
private void OnNextPageRequested(object sender, EventArgs e) { ActiveTab.OnRequestNextPage(); }