Exemplo n.º 1
0
        private void Button_NavLocator_Clicked(object sender, EventArgs e)
        {
            string username = "";

            ActorPrimus.stopActors();
            Navigation.PushModalAsync(new LocatorPage(username));
        }
Exemplo n.º 2
0
        public AddFriendsPage()
        {
            InitializeComponent();
            InitializePageDesign();

            ActorPrimus.Initialise();

            Props addFriendProps = Props.Create <AddFriend>();

            addFriendActor = ActorPrimus.MainActorSystem.ActorOf(addFriendProps, "addFriendActor");

            MessagingCenter.Subscribe <DBSupervisor>(this, "noInternet", (sender) =>
            {
                Console.WriteLine("************************************************************MessagingCenter noInternet");
                DisplayAlert("No Internet Connection.", "The application cannot connect to the internet, please ensure that your device is connected to a valid network.", "OK");
            });
        }
Exemplo n.º 3
0
        public PendingFriendRequests()
        {
            InitializeComponent();
            InitializePageDesign();
            PendingFriendCollection.Clear();


            ActorPrimus.Initialise();

            Props GetPendingFriendsProps = Props.Create <GetPendingFriends>();

            getPendingFriendsActor = ActorPrimus.MainActorSystem.ActorOf(GetPendingFriendsProps, "getPendingFriendsActor");

            Props ConfirmFriendRequestProps = Props.Create <ConfirmFriendRequest>();

            confirmFriendRequestActor = ActorPrimus.MainActorSystem.ActorOf(ConfirmFriendRequestProps, "confirmFriendRequestActor");

            MessagingCenter.Subscribe <DBSupervisor>(this, "noInternet", (sender) =>
            {
                Console.WriteLine("************************************************************MessagingCenter noInternet");
                DisplayAlert("No Internet Connection.", "The application cannot connect to the internet, please ensure that your device is connected to a valid network.", "OK");
            });

            MessagingCenter.Subscribe <GetPendingFriends, List <string> >(this, "hasFriends", (sender, arg) =>
            {
                Console.WriteLine("**************************************************************MessagingCenter has friends.");
                // if the list has at least one value
                if (arg.Count > 0)
                {
                    loadFriends(arg);
                }
                else
                {
                    noFriends();
                }
            });

            MessagingCenter.Subscribe <GetPendingFriends, List <string> >(this, "hasNoFriends", (sender, arg) =>
            {
                Console.WriteLine("*************************************************************MessagingCenter hasNoFriends");
                noFriendList();
            });
            FriendListView.ItemsSource = PendingFriendCollection;
            getFriends();
        }
Exemplo n.º 4
0
        public HomePage()
        {
            InitializeComponent();
            InitializePageDesign();
            FriendCollection.Clear();

            ActorPrimus.Initialise();

            Props getFriendProps = Props.Create <GetFriends>();

            getFriendsActor = ActorPrimus.MainActorSystem.ActorOf(getFriendProps, "getFriendsActor");

            Props getLocationProps = Props.Create <GetLocationActor>();

            getLocationActor = ActorPrimus.MainActorSystem.ActorOf(getLocationProps, "getLocationActor");

            if (!User.CheckInternetConnection())
            {
                DisplayAlert("No Internet Connection", "Please connect to the internet, this application will not function properly" +
                             " without it", "OK");
                return;
            }

            // sends the context of the application to the GetLocationActor which will in turn
            // call the getlocation functionality of the getLocation class


            FriendListView.ItemsSource = FriendCollection;
            InitialiseMessagingCenters();
            getFriends();
            Console.WriteLine("************************************************** Calling GetLocationActor");

            ActorPrimus.MainActorSystem.ActorOf(Props.Create(
                                                    () => new GetLocationActor(getLocationActor, Droid.MainActivity.activity)));


            //ActorPrimus.GetLocationActor.Tell(new GetLocationActor(getLocationActor, Droid.MainActivity.activity));
            Console.WriteLine("**************************************************After Calling GetLocationActor");
        }
Exemplo n.º 5
0
 private void Button_NavAddFriends_Clicked(object sender, EventArgs e)
 {
     ActorPrimus.stopActors();
     Navigation.PushModalAsync(new AddFriendsPage());
     //NavigationCode.GoAddFriends();
 }
Exemplo n.º 6
0
 private void Button_NavPending_Clicked(object sender, EventArgs e)
 {
     ActorPrimus.stopActors();
     Navigation.PushModalAsync(new Mobile_Locator_App.Xaml.PendingFriendRequests());
 }
Exemplo n.º 7
0
 private void Button_NavHome_Clicked(object sender, EventArgs e)
 {
     ActorPrimus.stopActors();
     Navigation.PushModalAsync(new HomePage());
     //NavigationCode.GoHome();
 }
Exemplo n.º 8
0
 private void Button_NavAddFriends_Clicked(object sender, EventArgs e)
 {
     ActorPrimus.stopActors();
     Navigation.PushModalAsync(new Mobile_Locator_App.Xaml.AddFriendsPage());
 }