internal void UpdateItemSelected(GameTime gameTime, IPageItem item) { if (item.CanGift()) { present.Update(gameTime); } else { presentDisabled.Update(gameTime); presentDisabledText.SetText(RetroEnvironment.GetLanguageManager().TryGetValue(presentDisabledText.GetOriginalText())); presentDisabledText.Update(gameTime); } buy.Update(gameTime); Amount.SetText(RetroEnvironment.GetLanguageManager().TryGetValue(Amount.GetOriginalText())); Price.SetText(RetroEnvironment.GetLanguageManager().TryGetValue(Price.GetOriginalText())); amountText.SetText("10"); amountText.Update(gameTime); Amount.Update(gameTime); Price.Update(gameTime); priceOneText.SetText((item.GetPrices()[0] * int.Parse(amountText.GetText())).ToString()); priceTwoText.SetText("+ " + (item.GetPrices()[1] * int.Parse(amountText.GetText())).ToString()); priceOneText.Update(gameTime); priceTwoText.Update(gameTime); }
/// <summary> /// Writes a page item to the given PDF page writer. /// </summary> public void Write(IPageItem pageItem, PdfPageWriter writer) { var context = new Context(); context.Coordinates = GetCoordinates(writer); this.Dispatch(pageItem, writer, context); }
protected void Dispatch(IPageItem pageItem, PdfPageWriter writer, Context context) { if (!pageItem.Hidden) { this.GetType().GetMethod("Handle" + pageItem.GetType().Name, BindingFlags.Instance | BindingFlags.NonPublic).Invoke(this, new object[] { pageItem, writer, context }); } }
/// <summary> /// 载入页面关联的按钮配置 /// </summary> /// <param name="loginUser">登录用户</param> /// <param name="page">页面,不能为空</param> /// <returns>按钮配置集合</returns> List <string> IPowerChecker.LoadPageButtons(ILoginUser loginUser, IPageItem page) { if (page == null) { return(new List <string>()); } return(PageItemLogical.LoadPageButtons(page.Id)); }
/// <summary> /// 读取用户的查询历史 /// </summary> /// <param name="loginUser">用户</param> /// <param name="page">关联页面</param> /// <returns>返回的是参数字典的JSON格式的文本</returns> string IPowerChecker.LoadQueryHistory(ILoginUser loginUser, IPageItem page) { if (page == null || loginUser == null) { return(null); } return(PageDataBusinessLogical.LoadQueryHistory(loginUser.Id, page.Id)); }
/// <summary> /// 保存用户的查询历史 /// </summary> /// <param name="loginUser">用户</param> /// <param name="page">关联页面</param> /// <param name="args">查询参数</param> void IPowerChecker.SaveQueryHistory(ILoginUser loginUser, IPageItem page, Dictionary <string, string> args) { if (page == null || loginUser == null) { return; } PageDataBusinessLogical.SaveQueryHistory(loginUser.Id, page.Id, args); }
/// <summary> /// 载入页面关联的按钮配置 /// </summary> /// <param name="loginUser">登录用户</param> /// <param name="page">页面,不能为空</param> /// <returns>按钮配置集合</returns> List <string> IPowerChecker.LoadPageButtons(ILoginUser loginUser, IPageItem page) { if (page == null) { return(new List <string>()); } return(BusinessContext.Current.IsSystemMode ? PageItemLogical.LoadPageButtons(page.Id) : RoleCache.LoadButtons(loginUser.RoleId, page.ID)); }
/// <summary> /// 载入页面关联的按钮配置 /// </summary> /// <param name="loginUser">登录用户</param> /// <param name="page">页面</param> /// <param name="action">动作</param> /// <returns>是否可执行页面动作</returns> bool IPowerChecker.CanDoAction(ILoginUser loginUser, IPageItem page, string action) { if (BusinessContext.Current.IsSystemMode) { return(true); } if (defaults.ContainsKey(action)) { return(defaults[action]); } return(page != null && RoleCache.CanDoAction(loginUser.RoleId, page.Id, action)); }
internal void SelectItem(int pageId, int itemId) { itemIsSelected = false; selectedItem = null; if (openPageId == pageId && itemId != -1) { IPageItem item = GetPage(pageId).GetItemById(itemId); if (item != null) { itemIsSelected = true; selectedItem = item; } } }
public CatalogusManager(ContentManager content) { pages = new Dictionary <CatalogusPage, int>(); promotions = new CatalogusPromotion[4];// new List<CatalogusPromotion>(); promotions[0] = new CatalogusPromotion(content); promotions[1] = new CatalogusPromotion(content); promotions[2] = new CatalogusPromotion(content); promotions[3] = new CatalogusPromotion(content); mode = String.Empty; pageTemplate = String.Empty; selectedItem = null; pageNameFont = new Font(content, "Fonts/cataPageName", "", new Color(106, 106, 106)); Catalogus = new CatalogusContent(content, new Vector2i(0, 0), new Vector2i(425, 300)); catalogusImageManager = new CatalogusImageManager(content); }
public CataItemSection(ContentManager content, int pageId, IPageItem item, Vector2i position, Vector2i size, out int bodySize) { images = new List <Image>(); fonts = new List <Font>(); headerT = new List <Image>(); headerF = new List <Font>(); this.size = size; this.localPosition = position; this.item = item; this.pageId = pageId; delay = new Timer(200); delay.Elapsed += Delay_Elapsed; #region Section Header String classname = String.Empty; if (GameScreenManager.Instance.GetFurniTypeBySpriteId(item.GetSpriteId()) != null) { classname = GameScreenManager.Instance.GetFurniTypeBySpriteId(item.GetSpriteId()).classname; } Logger.Debug("Generating header for:", classname); if (classname != String.Empty) { if (File.Exists(@"Content/Client/Items/" + classname + "/icon.xnb")) { GameScreenManager.Instance.GetCatalogusManager().catalogusImageManager.GetFurniIcon(classname, out icon); } else { icon = new Image(content, @"Client/Items/CantFindTextureTextures/item_small", Vector2.Zero); } } else { icon = new Image(content, @"Client/Items/CantFindTextureTextures/item_small", Vector2.Zero); } icon.SetPosition(position + new Vector2i(size.X / 2 - icon.dimensions.X / 2, size.Y / 2 - icon.dimensions.Y / 2)); headerT.Add(icon); smallCredit = new Image(content, @"Menu/Catalogus/Items/Small/credits", Vector2.Zero); smallDiamond = new Image(content, @"Menu/Catalogus/Items/Small/diamonds", Vector2.Zero); smallDucket = new Image(content, @"Menu/Catalogus/Items/Small/duckets", Vector2.Zero); smallGotw = new Image(content, @"Menu/Catalogus/Items/Small/gotw", Vector2.Zero); Font priceOne = new Font(content, "Fonts/Catalogus/CurrencyTitle", item.GetPrices()[0].ToString(), new Color(11, 11, 11)); //125, 216, 246 priceOne.SetPosition(position + new Vector2i(34 - priceOne.measureString().X, 41 + ((11 / 2) - (priceOne.measureString().Y / 2)))); headerF.Add(priceOne); Font priceTwo = new Font(content, "Fonts/Catalogus/CurrencyTitle", "+ 0", new Color(11, 11, 11)); //125, 216, 246 priceTwo.SetPosition(position + new Vector2i(34 - priceTwo.measureString().X, 55 + ((11 / 2) - (priceOne.measureString().Y / 2)))); switch (item.GetPricesTypes()[0]) { case PriceTypes.CREDITS: headerT.Add(smallCredit); break; case PriceTypes.DUCKETS: headerT.Add(smallDucket); break; case PriceTypes.DIAMONDS: headerT.Add(smallDiamond); break; case PriceTypes.GOTW: headerT.Add(smallGotw); break; default: Logger.Error("Unknown price type:", item.GetPricesTypes()[0].ToString()); break; } if (item.IsDubbelPriced()) { headerF.Add(priceTwo); switch (item.GetPricesTypes()[1]) { case PriceTypes.DUCKETS: headerT.Add(smallDucket); break; case PriceTypes.DIAMONDS: headerT.Add(smallDiamond); break; case PriceTypes.GOTW: headerT.Add(smallGotw); break; default: Logger.Error("Unknown price type:", item.GetPricesTypes()[1].ToString()); break; } } #endregion bodySize = size.Y; }
private static void Add(IPageItem page) { _pageCollection.Add(page.PageIndex, new HelpDocFrame(page)); }
public CatalogusPage AddItem(IPageItem item) { this.items.Add(item); return(this); }
/// <summary> /// 载入用户的单页角色权限 /// </summary> /// <param name="loginUser">登录用户</param> /// <param name="page">页面</param> /// <returns></returns> IRolePower IPowerChecker.LoadPagePower(ILoginUser loginUser, IPageItem page) { return(null); }
/// <summary> /// 载入页面关联的按钮配置 /// </summary> /// <param name="loginUser">登录用户</param> /// <param name="page">页面</param> /// <param name="action">动作</param> /// <returns>是否可执行页面动作</returns> bool IPowerChecker.CanDoAction(ILoginUser loginUser, IPageItem page, string action) { return(true); }
public HelpDocFrame(IPageItem page) { _page = page; Navigate(_page); }
/// <summary> /// 载入用户的单页角色权限 /// </summary> /// <param name="loginUser">登录用户</param> /// <param name="page">页面</param> /// <returns></returns> IRolePower IPowerChecker.LoadPagePower(ILoginUser loginUser, IPageItem page) { return(page == null ? null : RoleCache.LoadPagePower(loginUser.RoleId, page.Id)); }
internal void DrawItemIsSelected(SpriteBatch spriteBatch, IPageItem item, float depth = 0.92f) { if (item.CanGift()) { present.Draw(spriteBatch, position + new Vector2i(207, headerHeight + rootContainer.GetHeight() + 5 + 90 + 439), depth); } else { presentDisabled.Draw(spriteBatch, position + new Vector2i(207, headerHeight + rootContainer.GetHeight() + 5 + 90 + 439), depth - 0.01f); presentDisabledText.Draw(spriteBatch, new Vector2i((presentDisabled.Size.X / 2) - (presentDisabledText.measureString().X / 2), (presentDisabled.Size.Y / 2) - (presentDisabledText.measureString().Y / 2)) + position + new Vector2i(207, headerHeight + rootContainer.GetHeight() + 5 + 90 + 439), depth); } buy.Draw(spriteBatch, position + new Vector2i(387, headerHeight + rootContainer.GetHeight() + 5 + 90 + 439), depth); Amount.Draw(spriteBatch, position + new Vector2i(207, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (Amount.measureString().Y / 2))), depth); Price.Draw(spriteBatch, position + new Vector2i(387, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (Price.measureString().Y / 2))), depth); amountText.Draw(spriteBatch, position + new Vector2i(207 + Amount.measureString().X + 20, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (amountText.measureString().Y / 2))), depth); if (item.IsDubbelPriced()) { priceOneText.Draw(spriteBatch, position + new Vector2i(536 - priceCredits.GetTexture().Width - priceTwoText.measureString().X - 5 - priceOneText.measureString().X, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceOneText.measureString().Y / 2))), depth); priceCredits.Draw(spriteBatch, position + new Vector2i(536 - priceCredits.GetTexture().Width - priceTwoText.measureString().X, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceCredits.GetTexture().Height / 2))), depth); priceTwoText.Draw(spriteBatch, position + new Vector2i(536 - priceTwoText.measureString().X, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceTwoText.measureString().Y / 2))), depth); switch (item.GetPricesTypes()[1]) { case PriceTypes.DUCKETS: priceDuckets.Draw(spriteBatch, position + new Vector2i(538, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceDuckets.GetTexture().Height / 2))), depth); break; case PriceTypes.DIAMONDS: priceDiamonds.Draw(spriteBatch, position + new Vector2i(538, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceDiamonds.GetTexture().Height / 2))), depth); break; case PriceTypes.GOTW: priceGotw.Draw(spriteBatch, position + new Vector2i(538, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceGotw.GetTexture().Height / 2))), depth); break; default: Logger.Error("Unknown price type:", item.GetPricesTypes()[0].ToString()); break; } } else { priceOneText.Draw(spriteBatch, position + new Vector2i(536 - priceOneText.measureString().X, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceOneText.measureString().Y / 2))), depth); switch (item.GetPricesTypes()[0]) { case PriceTypes.CREDITS: priceCredits.Draw(spriteBatch, position + new Vector2i(538, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceCredits.GetTexture().Height / 2))), depth); break; case PriceTypes.DUCKETS: priceDuckets.Draw(spriteBatch, position + new Vector2i(538, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceDuckets.GetTexture().Height / 2))), depth); break; case PriceTypes.DIAMONDS: priceDiamonds.Draw(spriteBatch, position + new Vector2i(538, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceDiamonds.GetTexture().Height / 2))), depth); break; case PriceTypes.GOTW: priceGotw.Draw(spriteBatch, position + new Vector2i(538, headerHeight + rootContainer.GetHeight() + 5 + 90 + 406 + ((33 / 2) - (priceGotw.GetTexture().Height / 2))), depth); break; default: Logger.Error("Unknown price type:", item.GetPricesTypes()[0].ToString()); break; } } }