示例#1
0
 public CompleteStats()
 {
     InitializeComponent();
     landRequest = new LandRequests(Constants.BaseApiUrl);
     landRequest.StatsReceived += landRequest_StatsReceived;
     landRequest.GetStats();
 }
示例#2
0
        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;
        }
示例#3
0
        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();
        }
示例#4
0
        public LandActivity(int landId)
        {
            InitializeComponent();

            landRequests = new LandRequests(Constants.BaseApiUrl);
            landRequests.ActivityReceived += landRequests_ActivityReceived;
            landRequests.GetActivity(landId);
        }
示例#5
0
 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;
 }
示例#6
0
        public AlertedLandLayer(string name)
            : base(name)
        {
            source     = new MemoryProvider();
            DataSource = source;

            landRequest = new LandRequests(Constants.BaseApiUrl);
            landRequest.LandByStatusReceived += LandRequestLandByStatusReceived;
            RequestAlertedAreas();
        }
示例#7
0
        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);
        }
示例#8
0
        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;
        }
示例#9
0
 private void Init()
 {
     landRequest = new LandRequests(Constants.BaseApiUrl);
     landRequest.LandByStatusReceived += LandRequestLandByStatusReceived;
     landRequest.GetLandByStatus(LandStatus.Alert);
 }
示例#10
0
        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;
        }