public PollsWindow(List<string> _codes) { InitializeComponent(); codes = _codes; if (codes.Count > 5) { this.BonusGrid.Visibility = System.Windows.Visibility.Visible; this.BonusText.Visibility = System.Windows.Visibility.Visible; this.Bonus.Visibility = System.Windows.Visibility.Visible; moreThan5 = true; } if (!string.IsNullOrEmpty(Current.Instance.LastImageDate)) { this.LastSatImgText.Text = Current.Instance.LastImageDate; } else { this.LastSatImgText.Text = Labels.Polls6; } landRequests = new LandRequests(Constants.BaseApiUrl); landRequests.PollAdded += landRequests_PollAdded; LoadNextImage(); }
public CompleteStats() { InitializeComponent(); landRequest = new LandRequests(Constants.BaseApiUrl); landRequest.StatsReceived += landRequest_StatsReceived; landRequest.GetStats(); }
public ReportWindow(Land land, Earthwatcher earthwatcher) { InitializeComponent(); commentRequests = new CommentRequests(Constants.BaseApiUrl); collectionRequests = new CollectionRequests(Constants.BaseApiUrl); landRequests = new LandRequests(Constants.BaseApiUrl); hexagonLayer = (HexagonLayer)Current.Instance.LayerHelper.FindLayer(Constants.Hexagonlayername); bcLayer = (BasecampLayer)Current.Instance.LayerHelper.FindLayer(Constants.BasecampsLayer); //TEST //Add event listeners commentRequests.CommentsByLandReceived += CommentRequestCommentsByLandReceived; collectionRequests.NewItemReceived += collectionRequests_NewItemReceived; collectionRequests.ItemsCountReceived += collectionRequests_ItemsCountReceived; collectionRequests.GetTotalItems(Current.Instance.Earthwatcher.Id); Current.Instance.MapControl.zoomFinished += MapControlZoomFinished; Current.Instance.MapControl.zoomStarted += MapControlZoomStarted; landRequests = new LandRequests(Constants.BaseApiUrl); landRequests.StatusChanged += SetLandStatusStatusChanged; landRequests.ConfirmationAdded += landRequests_ConfirmationAdded; hexagonLayer = (HexagonLayer)Current.Instance.LayerHelper.FindLayer(Constants.Hexagonlayername); this.Loaded += ReportWindow_Loaded; this.ShareStoryBoard.Completed += ShareStoryBoard_Completed; }
public LandActivity(int landId) { InitializeComponent(); landRequests = new LandRequests(Constants.BaseApiUrl); landRequests.ActivityReceived += landRequests_ActivityReceived; landRequests.GetActivity(landId); }
public Stats() { InitializeComponent(); landRequest = new LandRequests(Constants.BaseApiUrl); landRequest.StatsReceived += landRequest_StatsReceived; this.FadeOut1.Completed += FadeOut1_Completed; this.FadeOut2.Completed += FadeOut2_Completed; this.FadeOut3.Completed += FadeOut3_Completed; }
public AlertedLandLayer(string name) : base(name) { source = new MemoryProvider(); DataSource = source; landRequest = new LandRequests(Constants.BaseApiUrl); landRequest.LandByStatusReceived += LandRequestLandByStatusReceived; RequestAlertedAreas(); }
public HexagonInfo() { InitializeComponent(); commentRequests = new CommentRequests(Constants.BaseApiUrl); collectionRequests = new CollectionRequests(Constants.BaseApiUrl); landRequests = new LandRequests(Constants.BaseApiUrl); hexagonLayer = (HexagonLayer)Current.Instance.LayerHelper.FindLayer(Constants.Hexagonlayername); bcLayer = (BasecampLayer)Current.Instance.LayerHelper.FindLayer(Constants.BasecampsLayer); //TEST //Add event listeners commentRequests.CommentsByLandReceived += CommentRequestCommentsByLandReceived; collectionRequests.NewItemReceived += collectionRequests_NewItemReceived; collectionRequests.ItemsCountReceived += collectionRequests_ItemsCountReceived; Current.Instance.MapControl.zoomFinished += MapControlZoomFinished; Current.Instance.MapControl.zoomStarted += MapControlZoomStarted; HtmlPage.RegisterScriptableObject("HexagonInfo", this); collectionRequests.GetTotalItems(Current.Instance.Earthwatcher.Id); }
public CountrySelector(string currentPlayingCountry, int currentPlayingRegion) { InitializeComponent(); _worldMapImage = Earthwatchers.UI.Resources.ResourceHelper.GetBitmap("/Resources/Images/world-map.png"); _defaultText = Labels.SelectCountryFromMap; _selectedCountry = null; _mapCoutries = new List<MapCountry>(); _mapCoutries.Add(new MapCountry("AR", Labels.ARGENTINA, Color.FromArgb(255, 0, 73, 126), Color.FromArgb(255, 0, 147, 254))); _mapCoutries.Add(new MapCountry("CA", Labels.CANADA, Color.FromArgb(255, 255, 216, 0), Color.FromArgb(255, 255, 246, 0))); _mapCoutries.Add(new MapCountry("CN", Labels.CHINA, Color.FromArgb(255, 127, 0, 0), Color.FromArgb(255, 224, 0, 0))); var currentCountry = GetCountryByCode(currentPlayingCountry); if (currentCountry == null) { this.mapImage.Source = _worldMapImage; this.txtSelectedCountry.Text = _defaultText; } else { this.mapImage.Source = currentCountry.GetMapImage(); this.txtSelectedCountry.Text = currentCountry.GetDescription(); } this.nextButton.IsEnabled = false; earthwatcherRequests = new EarthwatcherRequests(Constants.BaseApiUrl); landRequests = new LandRequests(Constants.BaseApiUrl); scoreRequests = new ScoreRequests(Constants.BaseApiUrl); regionRequests = new RegionRequests(Constants.BaseApiUrl); earthwatcherRequests.PlayingRegionChanged += earthwatcherRequests_PlayingRegionChanged; earthwatcherRequests.LandReassignedByPlayingRegion += earthwatcherRequest_LandReassignedByPlayingRegion; landRequests.LandsReceived += landRequests_LandsReceived; regionRequests.RegionsReceived += regionRequests_RegionsReceived; }
private void Init() { landRequest = new LandRequests(Constants.BaseApiUrl); landRequest.LandByStatusReceived += LandRequestLandByStatusReceived; landRequest.GetLandByStatus(LandStatus.Alert); }
public ReportWindow(Land land, Earthwatcher earthwatcher) { InitializeComponent(); this.ShareStoryBoard.Completed += ShareStoryBoard_Completed; selectedLand = land; string[] oks = null; string[] alerts = null; char[] charsep = new char[] { ',' }; if (!string.IsNullOrEmpty(selectedLand.OKs)) { oks = selectedLand.OKs.Split(charsep, StringSplitOptions.RemoveEmptyEntries); } if (!string.IsNullOrEmpty(selectedLand.Alerts)) { alerts = selectedLand.Alerts.Split(charsep, StringSplitOptions.RemoveEmptyEntries); } if (Current.Instance.Earthwatcher.Lands.Any(x => x.Id == selectedLand.Id)) { //NO SELECCIONAR LA MANITO OK o ALERT SEGUN EL STATUS, SINO LO QUE EL USER REPORTO this.ReportGrid.Visibility = System.Windows.Visibility.Visible; this.ConfirmGrid.Visibility = System.Windows.Visibility.Collapsed; //if (land.LandStatus == LandStatus.Alert) if (alerts != null && alerts.Any(x => x.Equals(Current.Instance.Earthwatcher.Id.ToString()))) { this.AlertButton.BorderThickness = new Thickness(4); this.AlertButton.Background = new SolidColorBrush(Color.FromArgb(255, 241, 251, 187)); } //if (land.LandStatus == LandStatus.Ok) else if (oks != null && oks.Any(x => x.Equals(Current.Instance.Earthwatcher.Id.ToString()))) { this.OkButton.BorderThickness = new Thickness(4); this.OkButton.Background = new SolidColorBrush(Color.FromArgb(255, 241, 251, 187)); } } else { this.Title.Text = Labels.Report5; this.ReportButton.Content = Labels.Report11; this.ReportGrid.Visibility = System.Windows.Visibility.Collapsed; this.ConfirmGrid.Visibility = System.Windows.Visibility.Visible; if (oks != null && oks.Any(x => x.Equals(Current.Instance.Earthwatcher.Id.ToString()))) { this.ConfirmButton.BorderThickness = new Thickness(4); this.ConfirmButton.Background = new SolidColorBrush(Color.FromArgb(255, 241, 251, 187)); this.ConfirmButton.IsHitTestVisible = false; this.ConfirmButton.Cursor = Cursors.Arrow; } if (alerts != null && alerts.Any(x => x.Equals(Current.Instance.Earthwatcher.Id.ToString()))) { this.DeconfirmButton.BorderThickness = new Thickness(4); this.DeconfirmButton.Background = new SolidColorBrush(Color.FromArgb(255, 241, 251, 187)); this.DeconfirmButton.IsHitTestVisible = false; this.DeconfirmButton.Cursor = Cursors.Arrow; } } int countConfirm = 0; int countDeconfirm = 0; if (oks != null) { countConfirm = oks.Length; } if (alerts != null) { countDeconfirm = alerts.Length; } //asocia esto a algún mensaje que muestre confirmación / deconfirmación this.countConfirm1.Text = string.Format("{0} {1}", countConfirm + countDeconfirm, Labels.Report12); this.countConfirm2.Text = string.Format("{0} {1}", countConfirm + countDeconfirm, Labels.Report12); //Limite de 30 verificaciones if (selectedLand.IsLocked || selectedLand.DemandAuthorities) { DisableActions(); } /* if (land.DemandAuthorities) { this.shareText.Text = Labels.Share5; } * */ selectedEarthwatcher = earthwatcher; if (earthwatcher.IsPowerUser) { this.badgeIcon.Source = Earthwatchers.UI.Resources.ResourceHelper.GetBitmap("/Resources/Images/badgej.png"); ToolTipService.SetToolTip(this.badgeIcon, "Jaguar"); } if (Current.Instance.Scores.Count(x => x.Action == ActionPoints.Action.FoundTheJaguar.ToString()) != 0) { JaguarBadge.Visibility = Visibility.Visible; } if (Current.Instance.Scores.Any(x => x.Action.StartsWith(ActionPoints.Action.ContestWon.ToString()))) { this.ContestWinnerBadge.Visibility = Visibility.Visible; } landRequests = new LandRequests(Constants.BaseApiUrl); landRequests.StatusChanged += SetLandStatusStatusChanged; landRequests.ConfirmationAdded += landRequests_ConfirmationAdded; hexagonLayer = (HexagonLayer)Current.Instance.LayerHelper.FindLayer(Constants.Hexagonlayername); this.Loaded += ReportWindow_Loaded; }