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"); }); }
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(); }
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"); }