Ejemplo n.º 1
0
        //public MagazineViewModel(String uniqueId, String title, String subtitle, MagazineDataGroup group, string tumb, string b1, string b2)
        //    : base(uniqueId, title, subtitle)
        //{
        //    Title = title;
        //    Subtitle = subtitle;
        //    Thumbnail=tumb;
        //    DownloadOrReadButton=b1;
        //    SampleOrDeleteButton=b2;
        //    Button1Tag = "t1";
        //    Button2Tag = "t2";
        //    MagazineTag = "m1";

        //    this._group = group;
        //}

        public MagazineViewModel(String uniqueId, int colSpan, int rowSpan, int width, String title, String subtitle, MagazineDataGroup group, MagazineModel m)
            : base(uniqueId, title, subtitle)
        {
            _width = width;
            Title = m.Title;
            Subtitle = m.Subtitle;
            IsDownloaded = m.isDowloaded;
            IsSampleDownloaded = m.isSampleDowloaded;
            IsPaid = m.isPaid;
            FileName = m.fileName;
            RelativePath = m.relativePath;
            Thumbnail = String.Format("ms-appdata:///local/Covers/{0}", m.pngPath);
            PngFile = m.pngPath;
            PngUrl = m.pngUrl;
            PngPath = m.assetsDir + m.pngPath;
            SecondButtonVisible = true;
            Index = m.Index;
            ColSpan = colSpan;
            RowSpan = rowSpan;
            _width *= ColSpan;
            _height *= RowSpan;
            if (ColSpan > 1 && RowSpan > 1)
            {
                Thumbnail = Thumbnail.Replace(".png", "_newsstand.png");
                PngFile = PngFile.Replace(".png", "_newsstand.png");
                PngUrl = PngUrl.Replace(".png", "_newsstand.png");
                _width += 10;// *ColSpan;
                _height += 10;// *RowSpan;
            }
            //if (img != null)
            //{
            //    Image = img;
            //}
            //else 
            //{
            //    Image = new BitmapImage(new Uri(String.Format("ms-appdata:///local/{0}", m.pngPath)));
            //}
            //Thumbnail = String.Format("ms-appdata:///local/{0}", m.pngPath);
            var resourceLoader = new ResourceLoader();
            MagazineTag = m.fileName;

            if (m.isDowloaded)
            {
                DownloadOrReadButton = resourceLoader.GetString("read");
                SampleOrDeleteButton = resourceLoader.GetString("delete");
                Button1Tag = TAG_READ;
                Button2Tag = TAG_DEL;
            }
            else {
                DownloadOrReadButton = resourceLoader.GetString("download");
                SampleOrDeleteButton = resourceLoader.GetString("sample");
                if (!m.isDowloaded && !m.isPaid)
                {
                    SecondButtonVisible = false;
                }
                Button1Tag = TAG_DOWNLOAD;
                Button2Tag = TAG_SAMPLE;
            }

            this._group = group;
        }
Ejemplo n.º 2
0
        public static IReadOnlyList<MagazineViewModel> LoadMagazines(IList<LibrelioLocalUrl> magazines, IList<LibrelioLocalUrl> magazinesDownloaded, int width) {

           var list = new List<MagazineViewModel>();

            bool newGroup = false;
            MagazineDataGroup group = null;
            var loader = new ResourceLoader();
            if (GetGroup(loader.GetString("my_magazines")) == null) {

                group = new MagazineDataGroup(loader.GetString("my_magazines"), loader.GetString("my_magazines"), "");
                newGroup = true;

            } else {

                group = GetGroup(loader.GetString("my_magazines"));
            }

            if (newGroup) {

                _sampleDataSource.AllGroups.Add(group);
                newGroup = false;
            }

            for (int i = 0; i < magazinesDownloaded.Count; i++) {

                if (magazinesDownloaded[i].IsDownloaded) {

                    var m = new MagazineModel(magazinesDownloaded[i], i);
                    var item = GetItem(m.fileName);
                    if (item != null)
                    {
                        var b = item.Update(1, 1, width, m);
                        if (b) list.Add(item);
                        continue;
                    }

                    group.Items.Add(new MagazineViewModel(m.fileName, 1, 1, width, m.Title, m.Subtitle, group, m));
                }
            }

            newGroup = false;

            if (GetGroup(loader.GetString("all_magazines")) == null) {

                group = new MagazineDataGroup(loader.GetString("all_magazines"), loader.GetString("all_magazines"), "");
                newGroup = true;

            } else {

                group = GetGroup(loader.GetString("all_magazines"));
            }

            if (newGroup) {

                _sampleDataSource.AllGroups.Add(group);
                newGroup = false;
            }

            for (int i = 0; i < magazines.Count; i++) {

                var m = new MagazineModel(magazines[i], magazines[i].Index);
                var item = GetItem(m.fileName + "1");
                if (item != null)
                {
                    if (m.Index == 0)
                    {
                        var b = item.Update(2, 2, width, m);
                        if (b) list.Add(item);
                    }
                    else
                    {
                        var b = item.Update(1, 1, width, m);
                        if (b) list.Add(item);
                    }

                    continue;
                }

                if (m.Index == 0) {

                    var it = new MagazineViewModel(m.fileName + "1", 2, 2, width, m.Title, m.Subtitle, group, m);
                    if (it.IsDownloaded)
                        it.SecondButtonVisible = false;
                    if (it.Index < group.Items.Count)
                        group.Items.Insert(it.Index, it);
                    else
                        group.Items.Add(it);

                    list.Add(it);

                } else {

                    var it = new MagazineViewModel(m.fileName + "1", 1, 1, width, m.Title, m.Subtitle, group, m);
                    if (it.IsDownloaded)
                        it.SecondButtonVisible = false;
                    if (it.Index < group.Items.Count)
                        group.Items.Insert(it.Index, it);
                    else
                        group.Items.Add(it);

                    list.Add(it);
                }
            }

            var removeCollection = new ObservableCollection<MagazineViewModel>();
            for (int p = 0; p < group.Items.Count; p++)
            {
                var it = group.Items[p];
                var result = magazines.Any(magazine => magazine.FullName.Equals(it.FileName));
                if (!result)
                    removeCollection.Add(it);
            }
            foreach (var it in removeCollection)
            {
                group.Items.Remove(it);
            }

            return list;
        }
Ejemplo n.º 3
0
        //public MagazineViewModel(String uniqueId, String title, String subtitle, MagazineDataGroup group, string tumb, string b1, string b2)
        //    : base(uniqueId, title, subtitle)
        //{
        //    Title = title;
        //    Subtitle = subtitle;
        //    Thumbnail=tumb;
        //    DownloadOrReadButton=b1;
        //    SampleOrDeleteButton=b2;
        //    Button1Tag = "t1";
        //    Button2Tag = "t2";
        //    MagazineTag = "m1";

        //    this._group = group;
        //}

        public MagazineViewModel(String uniqueId, int colSpan, int rowSpan, int width, String title, String subtitle, MagazineDataGroup group, MagazineModel m)
            : base(uniqueId, title, subtitle)
        {
            _width              = width;
            Title               = m.Title;
            Subtitle            = m.Subtitle;
            IsDownloaded        = m.isDowloaded;
            IsSampleDownloaded  = m.isSampleDowloaded;
            IsPaid              = m.isPaid;
            FileName            = m.fileName;
            RelativePath        = m.relativePath;
            Thumbnail           = String.Format("ms-appdata:///local/Covers/{0}", m.pngPath);
            PngFile             = m.pngPath;
            PngUrl              = m.pngUrl;
            PngPath             = m.assetsDir + m.pngPath;
            SecondButtonVisible = true;
            Index               = m.Index;
            ColSpan             = colSpan;
            RowSpan             = rowSpan;
            _width             *= ColSpan;
            _height            *= RowSpan;
            if (ColSpan > 1 && RowSpan > 1)
            {
                Thumbnail = Thumbnail.Replace(".png", "_newsstand.png");
                PngFile   = PngFile.Replace(".png", "_newsstand.png");
                PngUrl    = PngUrl.Replace(".png", "_newsstand.png");
                _width   += 10; // *ColSpan;
                _height  += 10; // *RowSpan;
            }
            //if (img != null)
            //{
            //    Image = img;
            //}
            //else
            //{
            //    Image = new BitmapImage(new Uri(String.Format("ms-appdata:///local/{0}", m.pngPath)));
            //}
            //Thumbnail = String.Format("ms-appdata:///local/{0}", m.pngPath);
            var resourceLoader = new ResourceLoader();

            MagazineTag = m.fileName;

            if (m.isDowloaded)
            {
                DownloadOrReadButton = resourceLoader.GetString("read");
                SampleOrDeleteButton = resourceLoader.GetString("delete");
                Button1Tag           = TAG_READ;
                Button2Tag           = TAG_DEL;
            }
            else
            {
                DownloadOrReadButton = resourceLoader.GetString("download");
                SampleOrDeleteButton = resourceLoader.GetString("sample");
                if (!m.isDowloaded && !m.isPaid)
                {
                    SecondButtonVisible = false;
                }
                Button1Tag = TAG_DOWNLOAD;
                Button2Tag = TAG_SAMPLE;
            }

            this._group = group;
        }
Ejemplo n.º 4
0
        public static IReadOnlyList <MagazineViewModel> LoadMagazines(IList <LibrelioLocalUrl> magazines, IList <LibrelioLocalUrl> magazinesDownloaded, int width)
        {
            var list = new List <MagazineViewModel>();

            bool newGroup           = false;
            MagazineDataGroup group = null;
            var loader = new ResourceLoader();

            if (GetGroup(loader.GetString("my_magazines")) == null)
            {
                group    = new MagazineDataGroup(loader.GetString("my_magazines"), loader.GetString("my_magazines"), "");
                newGroup = true;
            }
            else
            {
                group = GetGroup(loader.GetString("my_magazines"));
            }

            if (newGroup)
            {
                _sampleDataSource.AllGroups.Add(group);
                newGroup = false;
            }

            for (int i = 0; i < magazinesDownloaded.Count; i++)
            {
                if (magazinesDownloaded[i].IsDownloaded)
                {
                    var m    = new MagazineModel(magazinesDownloaded[i], i);
                    var item = GetItem(m.fileName);
                    if (item != null)
                    {
                        var b = item.Update(1, 1, width, m);
                        if (b)
                        {
                            list.Add(item);
                        }
                        continue;
                    }

                    group.Items.Add(new MagazineViewModel(m.fileName, 1, 1, width, m.Title, m.Subtitle, group, m));
                }
            }

            newGroup = false;

            if (GetGroup(loader.GetString("all_magazines")) == null)
            {
                group    = new MagazineDataGroup(loader.GetString("all_magazines"), loader.GetString("all_magazines"), "");
                newGroup = true;
            }
            else
            {
                group = GetGroup(loader.GetString("all_magazines"));
            }

            if (newGroup)
            {
                _sampleDataSource.AllGroups.Add(group);
                newGroup = false;
            }

            for (int i = 0; i < magazines.Count; i++)
            {
                var m    = new MagazineModel(magazines[i], magazines[i].Index);
                var item = GetItem(m.fileName + "1");
                if (item != null)
                {
                    if (m.Index == 0)
                    {
                        var b = item.Update(2, 2, width, m);
                        if (b)
                        {
                            list.Add(item);
                        }
                    }
                    else
                    {
                        var b = item.Update(1, 1, width, m);
                        if (b)
                        {
                            list.Add(item);
                        }
                    }

                    continue;
                }

                if (m.Index == 0)
                {
                    var it = new MagazineViewModel(m.fileName + "1", 2, 2, width, m.Title, m.Subtitle, group, m);
                    if (it.IsDownloaded)
                    {
                        it.SecondButtonVisible = false;
                    }
                    if (it.Index < group.Items.Count)
                    {
                        group.Items.Insert(it.Index, it);
                    }
                    else
                    {
                        group.Items.Add(it);
                    }

                    list.Add(it);
                }
                else
                {
                    var it = new MagazineViewModel(m.fileName + "1", 1, 1, width, m.Title, m.Subtitle, group, m);
                    if (it.IsDownloaded)
                    {
                        it.SecondButtonVisible = false;
                    }
                    if (it.Index < group.Items.Count)
                    {
                        group.Items.Insert(it.Index, it);
                    }
                    else
                    {
                        group.Items.Add(it);
                    }

                    list.Add(it);
                }
            }

            var removeCollection = new ObservableCollection <MagazineViewModel>();

            for (int p = 0; p < group.Items.Count; p++)
            {
                var it     = group.Items[p];
                var result = magazines.Any(magazine => magazine.FullName.Equals(it.FileName));
                if (!result)
                {
                    removeCollection.Add(it);
                }
            }
            foreach (var it in removeCollection)
            {
                group.Items.Remove(it);
            }

            return(list);
        }
Ejemplo n.º 5
0
        public static async Task<MagazineManager> LoadLocalMagazinesAsync()
        {
            if (_sampleDataSource.AllGroups.Count > 0) return null;

            var manager = new MagazineManager("http://librelio-europe.s3.amazonaws.com/niveales/wind/", "Magazines");

            await manager.LoadLocalMagazineList();

            bool newGroup = false;
            MagazineDataGroup group = null;
            if (GetGroup("My Magazines") == null) {

                group = new MagazineDataGroup("My Magazines", "My Magazines", "");
                newGroup = true;

            } else {

                group = GetGroup("My Magazines");
            }

            if (newGroup) {

                _sampleDataSource.AllGroups.Add(group);
                newGroup = false;
            }

            for (int i = 0; i < manager.MagazineLocalUrl.Count; i++) {

                if (manager.MagazineLocalUrl[i].IsDownloaded) {

                    var m = new MagazineModel(manager.MagazineLocalUrl[i], i);
                    if (GetItem(m.Title + m.Subtitle) != null) continue;
                    BitmapImage image = null;
                    try
                    {

                        var file = await StorageFile.GetFileFromPathAsync(m.pngPath);
                        image = new BitmapImage();
                        await image.SetSourceAsync(await file.OpenReadAsync());

                    }
                    catch { }
                    int index = 0;
                    for (int p = 0; p < group.Items.Count; p++)
                    {
                        index = p + 1;
                        if (group.Items[p].Index > m.Index)
                            break;
                    }
                    if (group.Items.Count == 0)
                        group.Items.Insert(index, new MagazineViewModel(m.Title + m.Subtitle, 2, 2, m.Title, m.Subtitle, image, group, m));
                    else
                        group.Items.Insert(index, new MagazineViewModel(m.Title + m.Subtitle, 1, 1, m.Title, m.Subtitle, image, group, m));
                }
            }

            newGroup = false;

            if (GetGroup("All Magazines") == null) {

                group = new MagazineDataGroup("All Magazines", "All Magazines", "");
                newGroup = true;

            } else {

                group = GetGroup("All Magazines");
            }

            if (newGroup)
            {
                _sampleDataSource.AllGroups.Add(group);
                newGroup = false;
            }

            for (int i = 0; i < manager.MagazineLocalUrl.Count; i++) {

                    var m = new MagazineModel(manager.MagazineLocalUrl[i], i);
                    if (GetItem(m.Title + m.Subtitle + "1") != null) continue;
                    BitmapImage image = null;
                    try
                    {
                        //if (m.isDowloaded) {

                        //    var file = await StorageFile.GetFileFromPathAsync(m.pngPath);
                        //    image = new BitmapImage();
                        //    await image.SetSourceAsync(await file.OpenReadAsync());

                        //} else {

                            image = new BitmapImage(new Uri(m.pngUrl));
                        //}

                    }
                    catch { }
                    int index = 0;
                    for (int p = 0; p < group.Items.Count; p++)
                    {
                        index = p + 1;
                        if (group.Items[p].Index > m.Index)
                            break;
                    }
                    MagazineViewModel item = null;
                    if (group.Items.Count == 0)
                        item = new MagazineViewModel(m.Title + m.Subtitle + "1", 2, 2, m.Title, m.Subtitle, image, group, m);
                    else
                        item = new MagazineViewModel(m.Title + m.Subtitle + "1", 1, 1, m.Title, m.Subtitle, image, group, m);

                    if (m.isDowloaded)
                        item.SecondButtonVisible = false;
                    group.Items.Insert(index, item);
            }

            return manager;
        }
Ejemplo n.º 6
0
        public static async Task<MagazineManager> LoadMagazinesAsync()
        {
            if (_sampleDataSource.AllGroups.Count > 0) return null;

            var manager = new MagazineManager("http://librelio-europe.s3.amazonaws.com/niveales/wind/", "Magazines");

            await manager.LoadLocalMagazineList();

            //if (manager.MagazineLocalUrl.Count == 0)
            //{
                //await manager.LoadPLISTAsync();
            //}

            bool newGroup = false;
            MagazineDataGroup group = null;
            if (GetGroup("My Magazines") == null) {

                group = new MagazineDataGroup("My Magazines", "My Magazines", "");
                newGroup = true;

            } else {

                group = GetGroup("My Magazines");
            }

            if (newGroup) {

                _sampleDataSource.AllGroups.Add(group);
                newGroup = false;
            }

            for (int i = 0; i < manager.MagazineLocalUrl.Count; i++)
            {

                if (manager.MagazineLocalUrl[i].IsDownloaded)
                {

                    var m = new MagazineModel(manager.MagazineLocalUrl[i], i);
                    if (GetItem(m.Title + m.Subtitle) != null) continue;
                    BitmapImage image = null;
                    try
                    {

                        var file = await StorageFile.GetFileFromPathAsync(m.pngPath);
                        image = new BitmapImage();
                        await image.SetSourceAsync(await file.OpenReadAsync());

                    }
                    catch { }
                    if (group.Items.Count == 0)
                        group.Items.Add(new MagazineViewModel(m.Title + m.Subtitle, 2, 2, m.Title, m.Subtitle, image, group, m));
                    else
                        group.Items.Add(new MagazineViewModel(m.Title + m.Subtitle, 1, 1, m.Title, m.Subtitle, image, group, m));
                }
            }

            newGroup = false;

            if (GetGroup("All Magazines") == null) {

                group = new MagazineDataGroup("All Magazines", "All Magazines", "");
                newGroup = true;

            } else {

                group = GetGroup("All Magazines");
            }

            if (newGroup)
            {
                _sampleDataSource.AllGroups.Add(group);
                newGroup = false;
            }

            await manager.LoadPLISTAsync();

            var count = manager.MagazineLocalUrl.Count;
            if (count == 0)
                count = manager.MagazineUrl.Count;
            for (int i = 0; i < count; i++)
            {
                LibrelioLocalUrl localUrl = null;
                MagazineModel m = null;
                //if (manager.MagazineLocalUrl.Count == 0)
                //{
                    localUrl = manager.FindInMetadata(manager.MagazineUrl[i]);
                    if (localUrl != null && localUrl.IsDownloaded)
                        m = new MagazineModel(localUrl, manager.MagazineUrl[i].Index);
                    else
                        m = new MagazineModel(manager.MagazineUrl[i]);
                //}
                //else
                //{
                    //localUrl = manager.MagazineLocalUrl[i];
                    //m = new MagazineModel(localUrl, i);
                //}

                if (GetItem(m.Title + m.Subtitle + "1") != null) continue;
                BitmapImage image = null;
                try
                {

                    if (localUrl != null && localUrl.IsDownloaded)
                    {

                        var file = await StorageFile.GetFileFromPathAsync(m.pngPath);
                        image = new BitmapImage();
                        await image.SetSourceAsync(await file.OpenReadAsync());

                    }
                    else
                    {

                        image = new BitmapImage(new Uri(m.pngUrl));
                    }

                }
                catch { }
                MagazineViewModel item = null;
                if (group.Items.Count == 0)
                    item = new MagazineViewModel(m.Title + m.Subtitle + "1", 2, 2, m.Title, m.Subtitle, image, group, m);
                else
                    item = new MagazineViewModel(m.Title + m.Subtitle + "1", 1, 1, m.Title, m.Subtitle, image, group, m);

                if (localUrl != null && localUrl.IsDownloaded)
                    item.SecondButtonVisible = false;
                group.Items.Add(item);
            }

            group.Items = new ObservableCollection<MagazineViewModel>(group.Items.OrderBy(item => item.Index));
            
            //if (GetGroup("All Magazines") != null) return null;

            //PList list = new PList("Assets/data/magazines.plist");
            ////TODODEBUG try

            //    List<dynamic> arr = list[""];
            //    group = new MagazineDataGroup("All Magazines", "All Magazines", "");
            //    for (int i = 0; i < arr.Count; i++)
            //    {
            //        var m = new MagazineModel((Dictionary<string, dynamic>)arr[i]);
            //        group.Items.Add(new MagazineViewModel("", "", "", null, group, m));
            //    }
            //    _sampleDataSource.AllGroups.Add(group);

            return manager;
        }
Ejemplo n.º 7
0
        public MagazineViewModel(String uniqueId, int colSpan, int rowSpan, String title, String subtitle, ImageSource img, MagazineDataGroup group, MagazineModel m)
            : base(uniqueId, title, subtitle)
        {
            Title = m.Title;
            Subtitle = m.Subtitle;
            IsDownloaded = m.isDowloaded;
            IsPaid = m.isPaid;
            FileName = m.fileName;
            RelativePath = m.relativePath;
            SecondButtonVisible = true;
            Index = m.Index;
            ColSpan = colSpan;
            RowSpan = rowSpan;
            _width *= ColSpan;
            _height *= RowSpan;
            if (ColSpan > 1 && RowSpan > 1)
            {
                _width += 10 * ColSpan;
                _height += 10 * RowSpan;
            }
            if (img != null)
            {
                Image = img;
            }
            else 
            {
                Image = new BitmapImage(new Uri(String.Format("ms-appdata:///local/{0}", m.pngPath)));
            }
            //Thumbnail = String.Format("ms-appdata:///local/{0}", m.pngPath);
            var resourceLoader = new ResourceLoader();
            MagazineTag = m.fileName;

            if (m.isDowloaded)
            {
                DownloadOrReadButton = resourceLoader.GetString("read");
                SampleOrDeleteButton = resourceLoader.GetString("delete");
                Button1Tag = TAG_READ;
                Button2Tag = TAG_DEL;
            }
            else {
                DownloadOrReadButton = resourceLoader.GetString("download");
                SampleOrDeleteButton = resourceLoader.GetString("sample");
                if (!m.isDowloaded && !m.isPaid)
                {
                    SecondButtonVisible = false;
                }
                Button1Tag = TAG_DOWNLOAD;
                Button2Tag = TAG_SAMPLE;
            }

            this._group = group;
        }
Ejemplo n.º 8
0
        public MagazineViewModel(String uniqueId, String title, String subtitle, MagazineDataGroup group, string tumb, string b1, string b2)
            : base(uniqueId, title, subtitle)
        {
            Title = title;
            Subtitle = subtitle;
            Thumbnail=tumb;
            DownloadOrReadButton=b1;
            SampleOrDeleteButton=b2;
            Button1Tag = "t1";
            Button2Tag = "t2";
            MagazineTag = "m1";

            this._group = group;
        }
Ejemplo n.º 9
0
        public static IReadOnlyList<MagazineViewModel> LoadMagazines(IList<LibrelioLocalUrl> magazines)
        {
            var list = new List<MagazineViewModel>();

            bool newGroup = false;
            MagazineDataGroup group = null;
            if (GetGroup("My Magazines") == null) {

                group = new MagazineDataGroup("My Magazines", "My Magazines", "");
                newGroup = true;

            } else {

                group = GetGroup("My Magazines");
            }

            if (newGroup) {

                _sampleDataSource.AllGroups.Add(group);
                newGroup = false;
            }

            for (int i = 0; i < magazines.Count; i++) {

                if (magazines[i].IsDownloaded) {

                    var m = new MagazineModel(magazines[i], i);
                    var item = GetItem(m.Title + m.Subtitle);
                    if (item != null)
                    {
                        var b = item.Update(1, 1, m);
                        if (b) list.Add(item);
                        continue;
                    }

                    group.Items.Add(new MagazineViewModel(m.Title + m.Subtitle, 1, 1, m.Title, m.Subtitle, group, m));
                }
            }

            newGroup = false;

            if (GetGroup("All Magazines") == null) {

                group = new MagazineDataGroup("All Magazines", "All Magazines", "");
                newGroup = true;

            } else {

                group = GetGroup("All Magazines");
            }

            if (newGroup) {

                _sampleDataSource.AllGroups.Add(group);
                newGroup = false;
            }

            for (int i = 0; i < magazines.Count; i++) {

                var m = new MagazineModel(magazines[i], i);
                var item = GetItem(m.Title + m.Subtitle + "1");
                if (item != null)
                {
                    if (item.Index == 0)
                    {
                        var b = item.Update(2, 2, m);
                        if (b) list.Add(item);
                    }
                    else
                    {
                        var b = item.Update(1, 1, m);
                        if (b) list.Add(item);
                    }

                    continue;
                }

                if (group.Items.Count == 0) {

                    var it = new MagazineViewModel(m.Title + m.Subtitle + "1", 2, 2, m.Title, m.Subtitle, group, m);
                    if (it.IsDownloaded)
                        it.SecondButtonVisible = false;
                    group.Items.Add(it);

                } else {

                    var it = new MagazineViewModel(m.Title + m.Subtitle + "1", 1, 1, m.Title, m.Subtitle, group, m);
                    if (it.IsDownloaded)
                        it.SecondButtonVisible = false;
                    group.Items.Add(it);
                }
            }

            return list;
        }