コード例 #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            var client = new GitHubOrganisationEventClient();

            // Alternative: Globale Events statt Organisation events anzeigen
            // var client = new GitHubGlobalEventClient();

            var service = new GitHubEventService(client);
            var browserTask = new AndroidBrowserTask(this);

            _viewModel = new GitHubEventListViewModel(service, browserTask);
            _adapter = new GitHubEventListAdapter(this, _viewModel);

            Button button = FindViewById<Button>(Resource.Id.main_button_refresh);
            Button buttonWebsite = FindViewById<Button>(Resource.Id.main_button_website);
            ListView listView = FindViewById<ListView>(Resource.Id.main_listview);

            _progressBar = FindViewById<ProgressBar>(Resource.Id.main_progressBar);

            button.Click += Button_Click;
            buttonWebsite.Click += (o, e) => { _viewModel.GoToGithubDotCom(); };
            listView.Adapter = _adapter;

            _viewModel.PropertyChanged += viewModel_PropertyChanged;

            UpdateViews(String.Empty);
        }
コード例 #2
0
ファイル: UnitTest1.cs プロジェクト: KaiBrummund/GitExplorer
        public async Task TestApiClientDownload()
        {
            var client = new GitHubOrganisationEventClient();
            var data = await client.DownloadEventsAsync();

            Assert.IsTrue(data.Count > 0);
        }
コード例 #3
0
ファイル: UnitTest1.cs プロジェクト: KaiBrummund/GitExplorer
        public async Task TestService()
        {
            var client = new GitHubOrganisationEventClient();
            var service = new GitHubEventService(client);
            var data = await service.GetEventsAsync();

            Assert.IsTrue(data.Count > 0);
        }
コード例 #4
0
        public MainPage()
        {
            this.InitializeComponent();

            var client = new GitHubOrganisationEventClient();
            var service = new GitHubEventService(client);
            var task = new WindowsBrowserTask();

            ViewModel = new GitHubEventListViewModel(service, task);
        }