コード例 #1
0
ファイル: Design.cs プロジェクト: will6767/pocketcampus
        public Design()
        {
            var eventsService = new DesignEventsService();
            var result        = eventsService.GetEventPoolAsync(null, CancellationToken.None).Result;
            var pool          = result.Pool;

            pool.Items = result.ChildrenItems.Values.ToArray();
            var itemRequest = new ViewEventItemRequest(0, true);

            CategoryFilter = new CategoryFilterViewModel(new DesignPluginSettings(), pool);
            EventItem      = new EventItemViewModel(new DesignDataCache(), new DesignNavigationService(), new DesignBrowserService(),
                                                    new DesignEventsService(), new DesignPluginSettings(),
                                                    itemRequest);
            EventPool = new EventPoolViewModel(new DesignDataCache(), new DesignNavigationService(), new DesignEventsService(),
                                               new DesignPluginSettings(), new DesignEmailPrompt(), new DesignCodeScanner(),
                                               -1);
            Settings  = new SettingsViewModel(new DesignPluginSettings());
            TagFilter = new TagFilterViewModel(new DesignPluginSettings(), pool);

            CategoryFilter.OnNavigatedTo();
            EventItem.OnNavigatedToAsync();
            EventPool.OnNavigatedToAsync();
            Settings.OnNavigatedTo();
            TagFilter.OnNavigatedTo();
        }
コード例 #2
0
        public override void OnNavigatedTo(NavigationParameters parameters)
        {
            base.OnNavigatedTo(parameters);

            if (parameters != null && parameters.ContainsKey("EventDetails"))
            {
                eventDetails = (EventItemViewModel)parameters["EventDetails"];
            }
        }
コード例 #3
0
        public void ConstructorTestOrSth()
        {
            DateTime time = DateTime.Now;

            var EventItemViewModel = new EventItemViewModel(69, time, false, 420, 2137, 7312);

            Assert.AreEqual(69, EventItemViewModel.Id);
            Assert.AreEqual(time, EventItemViewModel.Timestamp);
            Assert.IsFalse(EventItemViewModel.IsStocking);
            Assert.AreEqual(420, EventItemViewModel.Amount);
            Assert.AreEqual(2137, EventItemViewModel.CatalogId);
            Assert.AreEqual(7312, EventItemViewModel.UserId);
        }
コード例 #4
0
ファイル: EventsExtensions.cs プロジェクト: sokogfb/LMS-1
        public static EventItemViewModel ToViewModel(this Event dto)
        {
            EventItemViewModel viewModel = null;

            if (dto != null)
            {
                viewModel = new EventItemViewModel()
                {
                    Id = dto.Id.ToString(),
                };
            }

            return(viewModel);
        }
コード例 #5
0
ファイル: Design.cs プロジェクト: accandme/pocketcampus
        public Design()
        {
            var eventsService = new DesignEventsService();
            var result = eventsService.GetEventPoolAsync( null, CancellationToken.None ).Result;
            var pool = result.Pool;
            pool.Items = result.ChildrenItems.Values.ToArray();
            var itemRequest = new ViewEventItemRequest( 0, true );

            CategoryFilter = new CategoryFilterViewModel( new DesignPluginSettings(), pool );
            EventItem = new EventItemViewModel( new DesignDataCache(), new DesignNavigationService(), new DesignBrowserService(),
                                                new DesignEventsService(), new DesignPluginSettings(),
                                                itemRequest );
            EventPool = new EventPoolViewModel( new DesignDataCache(), new DesignNavigationService(), new DesignEventsService(),
                                                new DesignPluginSettings(), new DesignEmailPrompt(), new DesignCodeScanner(),
                                                -1 );
            Settings = new SettingsViewModel( new DesignPluginSettings() );
            TagFilter = new TagFilterViewModel( new DesignPluginSettings(), pool );

            CategoryFilter.OnNavigatedTo();
            EventItem.OnNavigatedToAsync();
            EventPool.OnNavigatedToAsync();
            Settings.OnNavigatedTo();
            TagFilter.OnNavigatedTo();
        }
コード例 #6
0
 /// <summary>
 /// Provides a deterministic way to create the SearchResultViewModelPropertyName property.
 /// </summary>
 public static void CreateSearchResultViewModelPropertyName()
 {
     if (_searchResultViewModelPropertyName == null)
     {
         _searchResultViewModelPropertyName = new EventItemViewModel(_service);
     }
 }
コード例 #7
0
 /// <summary>
 /// Provides a deterministic way to delete the SearchResultViewModelPropertyName property.
 /// </summary>
 public static void ClearSearchResultViewModelPropertyName()
 {
     _searchResultViewModelPropertyName.Cleanup();
     _searchResultViewModelPropertyName = null;
 }