public VMGameMenuImgGame this[string gameName]
        {
            get
            {
                var model = new VMGameMenuImgGame
                {
                    Title          = "Все записи",
                    GoodPictureUrl = EmptyGame.GoodImagePath,
                    BadPictureUrl  = EmptyGame.BadImagePath,
                    IconUrl        = EmptyGame.IconPath,
                    ImgWidth       = this.ImgWidth,
                    IconHeight     = this.IconHeight
                };

                if (string.IsNullOrEmpty(gameName))
                {
                    return(model);
                }

                for (int i = 0; i < Length; i++)
                {
                    var g = Games[i];
                    if (g.TitleUrl.ToLower() == gameName.ToLower())
                    {
                        model = new VMGameMenuImgGame
                        {
                            Title          = g.Title,
                            GoodPictureUrl = "/pictures/picture/" + g.GoodPictureId,
                            BadPictureUrl  = "/pictures/picture/" + g.BadPictureId,
                            IconUrl        = "/pictures/picture/" + g.FrontPictureId
                        };
                        break;
                    }
                }

                model.ImgWidth   = this.ImgWidth;
                model.IconHeight = this.IconHeight;
                return(model);
            }
        }
Esempio n. 2
0
        public VMGameMenuImgGame this[string gameName]
        {
            get
            {
                var model = new VMGameMenuImgGame
                {
                    Title="Все записи",
                    GoodPictureUrl=EmptyGame.GoodImagePath,
                    BadPictureUrl=EmptyGame.BadImagePath,
                    IconUrl=EmptyGame.IconPath,
                    ImgWidth=this.ImgWidth,
                    IconHeight=this.IconHeight
                };

                if (string.IsNullOrEmpty(gameName)) return model;

                for (int i = 0; i < Length; i++)
                {
                    var g = Games[i];
                    if (g.TitleUrl.ToLower() == gameName.ToLower())
                    {
                        model = new VMGameMenuImgGame
                        {
                            Title = g.Title,
                            GoodPictureUrl = "/pictures/picture/"+g.GoodPictureId,
                            BadPictureUrl = "/pictures/picture/" + g.BadPictureId,
                            IconUrl = "/pictures/picture/" + g.FrontPictureId
                        };
                        break;
                    }
                }

                model.ImgWidth = this.ImgWidth;
                model.IconHeight = this.IconHeight;
                return model;
            }
        }