Example #1
0
        // Show All user's projects
        private void projectsBtn_Click(object sender, EventArgs e)
        {
            mainPanel.Controls.Clear();
            topLabel.Text    = "List des projets :";
            topLabel.Visible = true;
            Form form = new ListOfProjects(projectList);

            form.TopLevel = false;
            mainPanel.Controls.Add(form);
            form.Show();
        }
Example #2
0
        private void _unloadData()
        {
            //for (int i = 0; i < 10; i++)
            //{
            //    ListOfProjects.Remove(ListOfProjects.Last());
            //}


            ListOfProjects.Clear();
            ListOfProjects = null;
            this.RaisePropertyChanged("ListOfProjects");
        }
Example #3
0
        public void RemoveProjectFromList(int projectIndex)
        {
            if (ListOfProjects[projectIndex].IsFinished)
            {
                _numOfFinishedProjects--;
            }
            else
            {
                _numOfUnfinishedProjects--;
            }

            ListOfProjects.RemoveAt(projectIndex);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Create UI

            _drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);

            // Init toolbar
            _toolbar       = FindViewById <Toolbar>(Resource.Id.toolbar);
            _toolbar.Title = this.Resources.GetString(Resource.String.app_name);
            SetSupportActionBar(_toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);
            //_toolbar.

            // Attach item selected handler to navigation view
            var navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetCheckedItem(0);
            navigationView.Menu.GetItem(0).SetChecked(true);

            navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected;

            // Create ActionBarDrawerToggle button and add it to the toolbar
            var drawerToggle = new ActionBarDrawerToggle(this, _drawerLayout, _toolbar, Resource.String.open_drawer,
                                                         Resource.String.close_drawer);

            _drawerLayout.SetDrawerListener(drawerToggle);
            //  drawerToggle.SetHomeAsUpIndicator(null);
            drawerToggle.SyncState();

            _loginFragment             = new Login();
            _homeFragment              = new Home();
            _settingsFragment          = new SettingsPage();
            _globalTimeLogFragment     = new GlobalTimeLogList();
            _timeLogDetailFragment     = new TimeLogDetail();
            _listOfProjectFragment     = new ListOfProjects();
            _taskDetailFragment        = new TaskDetails();
            _taskTimeLogDetailFragment = new TaskTimeLogList();
            _listOfTasksFragment       = new ListProjectTasks("");
            _testFragment              = new TestFragment();

            //for testing
            //_currentFragment = _testFragment;
            // if logged in
            _currentFragment = _homeFragment;
            // else
            //CurrentFragment = ListOfProjectFragment;

            var fragmentTx = FragmentManager.BeginTransaction();

            // The fragment will have the ID of Resource.Id.fragment_container.
            fragmentTx.Replace(Resource.Id.fragmentContainer, _currentFragment);
            // Commit the transaction.
            fragmentTx.Commit();

            var apiService = new ApiTypes();
            var service    = new PDashServices(apiService);

            Ctrl = new Controller(service);

            // ...
            CheckForCrashes();
            //  checkForUpdates();

            // FragmentManager.AddOnBackStackChangedListener(this);
            // shouldDisplayHomeUp();
        }
Example #5
0
 public void AddProjectToList(Project projectToAdd)
 {
     ListOfProjects.Add(projectToAdd);
     _numOfUnfinishedProjects++;
 }