Exemplo n.º 1
0
        private void CreateVisitsGroup(int todayItems, int otherItems)
        {
            if (todayItems > 0)
            {
                VisitsList.Add(new VisitsGroup
                {
                    GroupId   = TODAY_GROUP_ID,
                    GroupName = string.Format(loader.GetString("Visits_Today"), todayItems),
                    Items     = new ObservableCollection <VisitItem>(TodayVisits)
                });
            }
            if (otherItems > 0)
            {
                VisitsList.Add(new VisitsGroup
                {
                    GroupId   = OTHER_GROUP_ID,
                    GroupName = string.Format(loader.GetString("Visits_OtherVisits"), otherItems),
                    Items     = new ObservableCollection <VisitItem>(OtherVisits)
                });
            }

            RaisePropertyChanged(() => VisitsList);
        }
Exemplo n.º 2
0
        void CreateVisitsGroup(int todayItems, int otherItems)
        {
            if (todayItems > 0)
            {
                VisitsList.Add(new VisitsGroup
                {
                    GroupId   = TODAY_GROUP_ID,
                    GroupName = "Todays Visits",
                    Items     = new ObservableCollection <VMVisit>(TodayVisits)
                });
            }
            if (otherItems > 0)
            {
                VisitsList.Add(new VisitsGroup
                {
                    GroupId   = OTHER_GROUP_ID,
                    GroupName = "Other Visits",
                    Items     = new ObservableCollection <VMVisit>(OtherVisits)
                });
            }

            RaisePropertyChanged(() => VisitsList);
        }
Exemplo n.º 3
0
        public void Add <T>(T model)
        {
            var theType = model.GetType().Name;

            switch (theType)
            {
            case "User": UsersList.Add(model as User); return;

            case "News": NewsesList.Add(model as Dal.Models.News); return;

            case "Category": CategoriesList.Add(model as Category); return;

            case "Magazine": MagazinesList.Add(model as Magazine); return;

            case "SmartLink": SmartLinksList.Add(model as SmartLink); return;

            case "Comment": CommentsList.Add(model as Comment); return;

            case "Visit": VisitsList.Add(model as Visit); return;

            case "NewsLetter": NewsLettersList.Add(model as NewsLetter); return;

            case "Slider": SlidersList.Add(model as Slider); return;

            case "Slide": SlidesList.Add(model as Slide); return;

            case "UserMagazine": UserMagazinesList.Add(model as UserMagazine); return;

            case "State": StatesList.Add(model as State); return;

            case "City": CitiesList.Add(model as City); return;

            case "Media": MediasList.Add(model as Media); return;

            case "Report": ReportsList.Add(model as Report); return;

            case "Vote": VotesList.Add(model as Vote); return;

            case "Advertise": AdvertisesList.Add(model as Advertise); return;

            case "AdCategory": AdCategoriesList.Add(model as AdCategory); return;

            case "Galery": GaleriesList.Add(model as Galery); return;

            case "GaleryImage": GaleryImagesList.Add(model as GaleryImage); return;

            case "Image": ImagesList.Add(model as Image); return;

            case "KeyPoint": KeyPointsList.Add(model as KeyPoint); return;

            case "KeyPointsContainer": KeyPointsContainersList.Add(model as KeyPointsContainer); return;

            case "Quiz": QuizesList.Add(model as Quiz); return;

            case "Question": QuestionsList.Add(model as Question); return;

            case "Answer": AnswersList.Add(model as Answer); return;

            case "Option": OptionList.Add(model as Option); return;

            case "ItemList": ItemsListList.Add(model as ItemList); return;

            default: throw new Exception("The type " + theType + " is not supported.");
            }
        }