Beispiel #1
0
        protected override void OnResume()
        {
            // Handle when your app resumes
            IEDataSource ds = IEDataSource.GetInstance();

            ds.StartDataSource();
        }
Beispiel #2
0
        public ActiveMembersListPage()
        {
            InitializeComponent();
            this.Title = "Active Members";
            NavigationPage.SetHasNavigationBar(this, false);

            IEDataSource ds = IEDataSource.GetInstance();

            //List<IEMember> members = ds.Members.Select(member => member.Value).Where(member => (member.Status == IEMember.MEMBER_KNOWN || member.Status == IEMember.MEMBER_ACTIVE)).ToList();

            Items          = ds.ActiveItems;
            BindingContext = this;

            this.SettingsImage.GestureRecognizers.Add(new TapGestureRecognizer
            {
                Command = new Command(GotoSettingsPage),
                NumberOfTapsRequired = 1
            });
            this.UsersImage.GestureRecognizers.Add(new TapGestureRecognizer
            {
                Command = new Command(GotoNewMembersPage),
                NumberOfTapsRequired = 1
            });
            this.RejectedImage.GestureRecognizers.Add(new TapGestureRecognizer
            {
                Command = new Command(GotoRejctedMembersPage),
                NumberOfTapsRequired = 1
            });
            this.SearchImage.GestureRecognizers.Add(new TapGestureRecognizer
            {
                Command = new Command(GotoSearchPage),
                NumberOfTapsRequired = 1
            });
        }
Beispiel #3
0
        public SearchPage()
        {
            IEDataSource ds = IEDataSource.GetInstance();

            Items = ds.SearchResults;

            InitializeComponent();

            this.Title = "Found (" + Items.Count() + ")";
            Items.CollectionChanged += (sender, e) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    this.Title     = "Found (" + Items.Count() + ")";
                    Items          = ds.SearchResults;
                    BindingContext = this;
                    this.OnPropertyChanging();
                });
            };
            BindingContext = this;

            this.SearchButton.Clicked += (sender, e) => {
                ds.DoNameSearch(this.SearchUsername.Text);
            };
        }
Beispiel #4
0
        protected override void OnSleep()
        {
            // Handle when your app sleeps
            IEDataSource ds = IEDataSource.GetInstance();

            ds.StopDataSource();
        }
Beispiel #5
0
        private async Task <bool> AcceptMember(IEMember member)
        {
            var ans = await DisplayAlert("Accepting", "Are you sure you want to accept " + member.Username + "?", "Accept", "Cancel");

            if (ans == true)
            {
                IEDataSource ds = IEDataSource.GetInstance();
                ds.ChangeMemberStatus(member, IEMember.MEMBER_KNOWN);
            }
            return(true);
        }
Beispiel #6
0
        private async Task <bool> RejectMember(IEMember member)
        {
            var ans = await DisplayAlert("Rejecting", "Are you sure you want to reject " + member.Username + "?", "Reject", "Cancel");

            if (ans == true)
            {
                IEDataSource ds = IEDataSource.GetInstance();
                ds.ChangeMemberStatus(member, IEMember.MEMBER_REJECTED);
                //member.Status = IEMember.MEMBER_REJECTED;
                //ds.SaveMember(member);
                //Items.Remove(member);
            }
            return(true);
        }
Beispiel #7
0
        protected override void OnStart()
        {
            // Handle when your app starts
            DesignTimeHelper.TurnOffDesignMode();

            IEDataSource ds = IEDataSource.GetInstance();

            if (ds.Running == false)
            {
                ds.StartDataSource();
            }

            MainPage = new NavigationPage(new ActiveMembersListPage());
        }
Beispiel #8
0
        protected void Initialise(IEMember member)
        {
            this.Title = member.Username + " (" + member.Age + ")";

            IEDataSource ds = IEDataSource.GetInstance();

            ds.GetMemberProfile(member);

            if (member.Status != IEMember.MEMBER_REJECTED)
            {
                member.RejectReason = "Not Rejected";
            }
            BindingContext = member;
        }
        public RejectedMembersListPage()
        {
            InitializeComponent();

            IEDataSource ds = IEDataSource.GetInstance();

            Items      = ds.RejectedItems;
            this.Title = "Rejected Members (" + Items.Count() + ")";
            Items.CollectionChanged += (sender, e) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    this.Title = "Rejected Members (" + Items.Count() + ")";
                });
            };
            BindingContext = this;
        }
Beispiel #10
0
        public NewMemberListPage()
        {
            InitializeComponent();

            IEDataSource ds = IEDataSource.GetInstance();

            //List<IEMember> members = ds.Members.Select(member => member.Value).Where(member => member.Status == IEMember.MEMBER_NEW).ToList();

            Items      = ds.NewItems;
            this.Title = "New Members (" + Items.Count() + ")";
            Items.CollectionChanged += (sender, e) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    this.Title = "New Members (" + Items.Count() + ")";
                });
            };
            BindingContext = this;
        }
Beispiel #11
0
        protected override void OnDisappearing()
        {
            IEDataSource ds = IEDataSource.GetInstance();

            IEMember member = BindingContext as IEMember;

            if (member != null)
            {
                if ((String.IsNullOrEmpty(member.RejectReason)) || (member.RejectReason.Equals("Not Rejected")))
                {
                    if (member.Status == IEMember.MEMBER_REJECTED)
                    {
                        member.Status = IEMember.MEMBER_KNOWN;
                    }
                }
                else
                {
                    member.Status = IEMember.MEMBER_REJECTED;
                }
                ds.SaveMember(member);
            }
        }