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 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 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(); earthwatcherRequest = new EarthwatcherRequests(Constants.BaseApiUrl); commentRequests = new CommentRequests(Constants.BaseApiUrl); landRequests = new LandRequests(Constants.BaseApiUrl); hexagonLayer = (HexagonLayer)Current.Instance.LayerHelper.FindLayer(Constants.Hexagonlayername); //Add event listeners commentRequests.CommentsByLandReceived += CommentRequestCommentsByLandReceived; earthwatcherRequest.EarthwatcherReceived += EarthwatcherChanged; Current.Instance.MapControl.zoomFinished += MapControlZoomFinished; Current.Instance.MapControl.zoomStarted += MapControlZoomStarted; HtmlPage.RegisterScriptableObject("HexagonInfo", this); }
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(); selectedLand = land; string[] confirms = null; string[] deconfirms = null; if (!string.IsNullOrEmpty(selectedLand.DeforestationConfirmers)) { confirms = selectedLand.DeforestationConfirmers.Split(','); } if (!string.IsNullOrEmpty(selectedLand.DeforestationDeconfirmers)) { deconfirms = selectedLand.DeforestationDeconfirmers.Split(','); } if (Current.Instance.Earthwatcher.LandId.HasValue && Current.Instance.Earthwatcher.LandId == selectedLand.Id) { this.ReportGrid.Visibility = System.Windows.Visibility.Visible; this.ConfirmGrid.Visibility = System.Windows.Visibility.Collapsed; if (land.LandStatus == LandStatus.Alert) { this.AlertButton.BorderThickness = new Thickness(4); this.AlertButton.Background = new SolidColorBrush(Color.FromArgb(255, 241, 251, 187)); } if (land.LandStatus == LandStatus.Ok) { this.OkButton.BorderThickness = new Thickness(4); this.OkButton.Background = new SolidColorBrush(Color.FromArgb(255, 241, 251, 187)); } } else { this.Title.Text = "VALIDAR PARCELA EN ALERTA"; this.ReportButton.Content = "VALIDAR"; this.ReportGrid.Visibility = System.Windows.Visibility.Collapsed; this.ConfirmGrid.Visibility = System.Windows.Visibility.Visible; if (confirms != null && confirms.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 (deconfirms != null && deconfirms.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; } } //asocia esto a algún mensaje que muestre confirmación / deconfirmación if (land.LandStatus == LandStatus.Alert) { int countConfirm = 0; int countDeconfirm = 0; if (confirms != null) { countConfirm = confirms.Length; } if (deconfirms != null) { countDeconfirm = deconfirms.Length; } this.countConfirm1.Text = string.Format("{0} confirmaciones", countConfirm); this.countConfirm2.Text = string.Format("{0} confirmaciones", countConfirm); this.countDeConfirm1.Text = string.Format("{0} nada sospechoso", countDeconfirm); this.countDeConfirm2.Text = string.Format("{0} nada sospechoso", countDeconfirm); } else { this.countConfirm1.Visibility = System.Windows.Visibility.Collapsed; this.countConfirm2.Visibility = System.Windows.Visibility.Collapsed; this.countDeConfirm1.Visibility = System.Windows.Visibility.Collapsed; this.countDeConfirm2.Visibility = System.Windows.Visibility.Collapsed; } selectedEarthwatcher = earthwatcher; landRequests = new LandRequests(Constants.BaseApiUrl); hexagonLayer = (HexagonLayer)Current.Instance.LayerHelper.FindLayer(Constants.Hexagonlayername); this.Loaded += ReportWindow_Loaded; }