Пример #1
0
		public async Task GoToSelectedEvent(string eveID)
		{
			IsLoading(true);
			Event eve = await _dataManager.EventApiManager.GetEventById(eveID);
			InspectController inspect = new InspectController(eve);
			setContentViewWithQueue(inspect);
			IsLoading(false);
		}
Пример #2
0
		public async Task GoToSelectedGroup(string groupID)
		{
			IsLoading(true);
			Group grp = await _dataManager.GroupApiManager.GetGroup(groupID);
			InspectController inspect = new InspectController(grp);
			setContentViewWithQueue(inspect);
			IsLoading(false);
		}
Пример #3
0
		public async Task updateHomeView()
		{
			App.userProfile = await GetLoggedInProfile();
			homeView = new InspectController(App.userProfile);
			myProfile = new CarouselList(
				new List<VisualElement>() { homeView, notifications },
				new List<string>() { "Me", "Notifications" },
				CarouselList.ViewType.Home
			);
		}
Пример #4
0
		public async Task GoToSelectedProfile(string id)
		{
			IsLoading(true);
			Profile pro = await _dataManager.ProfileApiManager.GetProfile(id);
			InspectController inspect = new InspectController(pro);
			setContentViewWithQueue(inspect);
			IsLoading(false);
		}
Пример #5
0
		private async void LaunchGroup(Group groupToCreate)
		{
			App.coreView.IsLoading(true);
			if (imageStreams != null)
			{
				groupToCreate.ImageSource = await _dataManager.UtilityManager.UploadImageToStorage(new MemoryStream(imageStreams[1]), App.StoredUserFacebookId + "." + DateTime.Now.ToString("G"));
			}
			groupToCreate.ProfileOwners = new List<Profile> {  new Profile() { ProfileId = App.userProfile.ProfileId, } };

			if (String.IsNullOrWhiteSpace(groupToCreate.Name))
			{
				await App.coreView.displayAlertMessage("Name Missing", "Name is missing", "Ok");
			}
			else if (String.IsNullOrWhiteSpace(groupToCreate.Description))
			{
				await App.coreView.displayAlertMessage("Description Missing", "Description is missing", "Ok");
			}
			else if (String.IsNullOrWhiteSpace(groupToCreate.ImageSource))
			{
				await App.coreView.displayAlertMessage("Banner Missing", "No banner has been selected", "Ok");
			}
			else {
				
				var groupCreated = await _dataManager.GroupApiManager.CreateEditGroup(groupToCreate);

				if (groupCreated != null)
				{
					InspectController inspect = new InspectController(groupCreated);
					App.coreView.setContentViewWithQueue(inspect);
					App.coreView.updateHomeView();
					App.coreView.createGroup = new CreateGroup(new Group(), true);
					App.coreView.updateCreateViews();
				}
				else {
					await App.coreView.displayAlertMessage("Error", "Event not created, try again", "Ok");
				}
			}
			Launching = false; 
			App.coreView.IsLoading(false);
		}
Пример #6
0
		public async void startCoreView()
		{
			notifications = new YourNotifications();
			homeView = new InspectController(App.userProfile);

			profileConversatios = new YourConversations(ConversationModelType.Profile, App.StoredUserFacebookId, 1);
			otherConversatios = new YourConversations(ConversationModelType.Profile, App.StoredUserFacebookId, 2);
			createEvent = new CreateEvent(new Event(), true);
			createGroup = new CreateGroup(new Group(), true);
			//createOrganization = new CreateOrganization(new Organization(), true);

			exploreEventCategories = new ExploreEventCategories();
			exploreEvents = new EventListView(0);
			joinedEvents = new EventListView(2);
			endedEvents = new EventListView(10);
			trackedEvents = new EventListView(3);
			friendsEvents = new EventListView(1);

			createView = new CarouselList(
				new List<VisualElement>() { createEvent, createGroup },
				new List<string>() { "Event", "Group" },
				CarouselList.ViewType.Create
			);

			conversatios = new CarouselList(
				new List<VisualElement>() { profileConversatios, otherConversatios },
				new List<string>() { "Yours", "Others" },
				CarouselList.ViewType.Conversations
			);

			searchEventView = new CarouselList(
				new List<VisualElement>() { exploreEventCategories, exploreEvents, friendsEvents, trackedEvents },
				new List<string>() { "Explore", "Explore", "Friends", "Followed" },
				CarouselList.ViewType.SearchEvents
			);

			joinedEventView = new CarouselList(
				new List<VisualElement>() { joinedEvents, endedEvents},
				new List<string>() { "Joined", "Old"},
				CarouselList.ViewType.JoinedEvents
			);

			myProfile = new CarouselList(
				new List<VisualElement>() { homeView, notifications },
				new List<string>() { "Me", "Notifications" },
				CarouselList.ViewType.Home
			);


			setContentView(2);
			await _dataManager.update();
			loading.IsVisible = false;

			if(token.Length > 15) displayAlertMessage("token", token, "ok");
		}
Пример #7
0
		public HomeView ()
		{
			InitializeComponent ();

			/*
			App.coreView.topBar.showSearchBar(true);
			App.coreView.topBar.showCreateNewButton(true);
			*/
			inspect = new InspectController(App.userProfile);
			profileContent.Content = inspect;

			searchBar.TextChanged += (sender, e) =>
			{
				if (String.IsNullOrWhiteSpace(searchBar.Text))
				{
					if (currentView != 0)
					{
						setViewDesign(0);
						profileGrid.Children.Clear();
						groupGrid.Children.Clear();
						//organizationGrid.Children.Clear();
					}
				}
				else {
					if (currentView != 1)
					{
						setViewDesign(1);
					}
					updateAutoCompleteProfileList(searchBar.Text);
					updateAutoCompleteGroupList(searchBar.Text);
					//updateAutoCompleteOrganizationsList(searchBar.Text);
				}
			};

			searchBar.Focused += (sender, e) =>
			{
				if (String.IsNullOrWhiteSpace(searchBar.Text))
				{
					setViewDesign(0);
				}
				else {
					setViewDesign(1);
				}
			};

			App.coreView.otherFunctions.selectButton(new List<Button> { optionOne, optionTwo, optionThree }, optionOne);
			optionOne.Clicked += (sender, e) =>
			{
				App.coreView.otherFunctions.selectButton(new List<Button> { optionOne, optionTwo, optionThree }, optionOne);
				profileGrid.IsVisible = true;
				groupGrid.IsVisible = false;
				organizationGrid.IsVisible = false;
			};
			optionTwo.Clicked += (sender, e) => {
				App.coreView.otherFunctions.selectButton(new List<Button> { optionOne, optionTwo, optionThree }, optionTwo);
				profileGrid.IsVisible = false;
				groupGrid.IsVisible = true;
				organizationGrid.IsVisible = false;
			};
			optionThree.Clicked += (sender, e) => {
				App.coreView.otherFunctions.selectButton(new List<Button> { optionOne, optionTwo, optionThree }, optionThree);
				organizationGrid.IsVisible = true;
				profileGrid.IsVisible = false;
				groupGrid.IsVisible = false;
			};

			/*
			ListsAndButtons listMaker = new ListsAndButtons();
			listMaker.createList(profileGrid, App.userProfile.Friends, null, null, null, null, null);
			listMaker.createList(groupGrid, null, App.userProfile.Groups, null, null, null, null);
			listMaker.createList(organizationGrid, null, null, App.userProfile.Organizations, null, null, null);
			*/
		}
Пример #8
0
		public async void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
		{
			ListView list = null;
			if (searchEventList.SelectedItem != null)
			{
				list = searchEventList;
			}
			else return;

			var selectedEvent = list.SelectedItem as EventForLists;

			if (currentView == 2)
			{
				_dataManager.setUpdateSeen(selectedEvent.eve.EventId, NotificationModelType.Event);
			}

			InspectController inspect = new InspectController(selectedEvent.eve);
			App.coreView.setContentViewWithQueue(inspect);
			list.SelectedItem = null;

			DependencyService.Get<ForceCloseKeyboard>().CloseKeyboard();
		}
Пример #9
0
		private async void GoToSelectedEvent(string eveID)
		{
			Event eve = await _dataManager.EventApiManager.GetEventById(eveID);

			InspectController inspect = new InspectController(eve);
			App.coreView.setContentViewWithQueue(inspect);

		}
Пример #10
0
		private async void LaunchEvent(Event eventToCreate)
		{
			App.coreView.IsLoading(true);
			if (imageStreams != null)
			{
				eventToCreate.ImageSource = await _dataManager.UtilityManager.UploadImageToStorage(new MemoryStream(imageStreams[2]), App.StoredUserFacebookId + "." + DateTime.Now.ToString("G"));
			}
			if (eventToCreate.GroupOwner == null)
			{
				eventToCreate.ProfileOwners = new List<Profile> { App.userProfile };
			}

			if (String.IsNullOrWhiteSpace (eventToCreate.Title)) {
				await App.coreView.displayAlertMessage ("Title Missing", "Title is missing", "Ok");
			} else if (String.IsNullOrWhiteSpace (eventToCreate.Description)) {
				await App.coreView.displayAlertMessage ("Description Missing", "Description is missing", "Ok");
			} else if ((eventToCreate.MaxSize == -1) || !validAttendingAmount) {
				await App.coreView.displayAlertMessage("Attendendees Needed Missing", "", "Ok");
			} else if (eventToCreate.EventTypes.Count == 0) {
				await App.coreView.displayAlertMessage ("EventTypes Missing", "No Event Type has been selected", "Ok");
			} else if (String.IsNullOrWhiteSpace (eventToCreate.AddressName) || eventToCreate.Latitude == 0) {
				await App.coreView.displayAlertMessage ("Address Missing", "No valid address has been selected", "Ok");
			} else if (String.IsNullOrWhiteSpace (eventToCreate.ImageSource)) {
				await App.coreView.displayAlertMessage ("Banner Missing", "No banner has been selected", "Ok");
			}else {
				
				eventToCreate.MinAge = 0;
				eventToCreate.MaxAge = 100;
				eventToCreate.MinSize = 1;


				Event eventCreated = await _dataManager.EventApiManager.CreateEditEvent(eventToCreate);

				if (eventCreated != null) {
					eventCreated.Attendees = new List<Profile> ();
					eventCreated.Followers = new List<Profile> ();
					InspectController inspect = new InspectController(eventCreated);
					if (isCreate)
					{
						App.coreView.setContentViewWithQueue(inspect);
						App.coreView.updateHomeView();
					}
					else {
						App.coreView.setContentViewReplaceCurrent(inspect, 2);
					}
					//setCreateView(new Event(), true);
					App.coreView.createEvent = new CreateEvent(new Event(), true);
					App.coreView.updateCreateViews();

				} else {
					await App.coreView.displayAlertMessage ("Error", "Event not created, try again", "Ok");
				}
			}
			Launching = false;
			App.coreView.IsLoading(false);
		}
Пример #11
0
		private async Task loadUpdatedProfile(Profile profile)
		{
			App.userProfile = await ProfileApiManager.GetLoggedInProfile ();
			InspectController inspect = new InspectController(profile);
			App.coreView.setContentViewWithQueue (inspect);
		}