public Ranking()
        {
            InitializeComponent();

            scoreRequests = new ScoreRequests(Constants.BaseApiUrl);
            contestRequests = new ContestRequests(Constants.BaseApiUrl);

            this.Loaded += Ranking_Loaded;
        }
        public NotificationsWindow(string action)
        {
            InitializeComponent();

            _action = action;

            scoreRequests = new ScoreRequests(Constants.BaseApiUrl);
            scoreRequests.ServerDateTimeReceived += scoreRequests_ServerDateTimeReceived;

            //Logo
            this.logo.Source = ResourceHelper.GetBitmap(string.Format("/Resources/Images/{0}", Labels.LogoPath));

            if (action.Equals("DemandAuthoritiesApproved"))
            {
                this.Title.Text = Labels.Notifications3;
                this.Body.Text = Labels.Notifications5;
            }

            if (action.Equals("NewLand"))
            {
                this.Title.Text = Labels.Notifications6;
                this.Body.Text = Labels.Notifications7;
            }

            if (action.Equals(ActionPoints.Action.LandReassigned.ToString()))
            {
                //Veo el DateTime del server
                scoreRequests.GetServerTime();
            }

            if (action.Equals("ChangeLand"))
            {
                this.Title.Text = Labels.Notifications13;
                this.Body.Text = Labels.Notifications14;
                this.ButtonClose.Visibility = System.Windows.Visibility.Collapsed;
                this.ButtonContinue.Visibility = System.Windows.Visibility.Visible;
            }

            if (action.Equals(ActionPoints.Action.LandVerified.ToString()))
            {
                this.Title.Text = Labels.Notifications3;
                this.Body.Text = Labels.Notifications15;
                this.ButtonClose.Visibility = System.Windows.Visibility.Collapsed;
                this.ButtonContinue.Visibility = System.Windows.Visibility.Visible;
            }

            if (action.Equals(ActionPoints.Action.LandVerifiedInformed.ToString()))
            {
                this.Title.Text = Labels.Notifications3;
                this.Body.Text = Labels.Notifications16;
                this.ButtonClose.Visibility = System.Windows.Visibility.Visible;
                this.ButtonContinue.Visibility = System.Windows.Visibility.Collapsed;
            }
        }
Exemplo n.º 3
0
        public DailySummary(string contestText)
        {
            InitializeComponent();

            scoreRequest = new ScoreRequests(Constants.BaseApiUrl);
            contestRequests = new ContestRequests(Constants.BaseApiUrl);

            if (Current.Instance.Scores != null && Current.Instance.Lands != null)
            {
                List<Score> ewScores = Current.Instance.Scores;
                this.Title.Text = Labels.DailySummaryTitle;
                this.HiUser.Text = String.Format("{0} {1}", Labels.DailySummaryHiUser, Current.Instance.Earthwatcher.FullName);

                this.YourPoints.Text = Labels.DailySummaryYourPoints;
                this.Points.Text = (ewScores.Sum(x => x.Points)).ToString();

                this.MorePoints.Text = Labels.DailySummaryMorePoints;


                //Denunciar (Primer Punto)
                this.Denounce1.Text = Labels.DailySummaryDenounce1;
                this.Denounce2.Text = (ewScores.Count(x => x.Action == ActionPoints.Action.DemandAuthorities.ToString())).ToString();
                this.Denounce3.Text = Labels.DailySummaryDenounce3;
                this.Denounce4.Text = (Current.Instance.Lands.Count(x => x.DemandAuthorities == true)).ToString() + ".";
                this.Denounce5.Text = Labels.DailySummaryDenounce5;

                //Verificar (Segundo Punto)
                this.Verify1.Text = Labels.DailySummaryVerify1;
                this.Verify2.Text = (ewScores.Count(x => x.Action == ActionPoints.Action.ConfirmationAdded.ToString())).ToString();
                this.Verify3.Text = Labels.DailySummaryVerify3;
                this.Verify4.Text = (Current.Instance.Lands.Count(x => x.LandStatus == LandStatus.Ok || x.LandStatus == LandStatus.Alert)).ToString() + ".";
                this.Verify5.Text = Labels.DailySummaryVerify5;

                //Reportar (Tercer Punto)
                this.Report1.Text = Labels.DailySummaryReport1;
                this.Report2.Text = (ewScores.Count(x => x.Action == ActionPoints.Action.LandStatusChanged.ToString())).ToString();
                this.Report3.Text = Labels.DailySummaryReport3;

                //Compartir (Cuarto Punto)
                this.Share1.Text = Labels.DailySummaryShare1;
                this.Share2.Text = (ewScores.Count(x => x.Action == ActionPoints.Action.Shared.ToString())).ToString();
                this.Share3.Text = Labels.DailySummaryShare3;

                this.Remember.Text = Labels.DailySummaryRemember;
                this.Contest.Text = contestText;
            }
        }
        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;
        }
        public DailySummary(string contestText, decimal? percentage)
        {
            InitializeComponent();

            scoreRequest = new ScoreRequests(Constants.BaseApiUrl);
            contestRequests = new ContestRequests(Constants.BaseApiUrl);

            if (Current.Instance.RegionScores != null && Current.Instance.Lands != null)
            {
                List<Score> ewScores = Current.Instance.RegionScores;
                this.Title.Text = Labels.DailySummaryTitle;
                var name = Current.Instance.Earthwatcher.FullName != null ? Current.Instance.Earthwatcher.FullName : Current.Instance.Earthwatcher.Name;
                this.HiUser.Text = String.Format("{0} {1}", Labels.DailySummaryHiUser, name);

                this.YourPoints.Text = Labels.DailySummaryYourPoints;
                this.Points.Text = (ewScores.Where(x => x.RegionId == Current.Instance.Earthwatcher.PlayingRegion).Sum(x => x.Points)).ToString();

                this.MorePoints.Text = Labels.DailySummaryMorePoints;

                //Denunciar (Primer Punto)
                this.Denounce.Text = Labels.DailySummaryDenounce;
                this.Denounce1.Text = Labels.DailySummaryDenounce1;
                this.Denounce2.Text = (ewScores.Where(x => x.RegionId == Current.Instance.Earthwatcher.PlayingRegion).Count(x => x.Action == ActionPoints.Action.DemandAuthorities.ToString())).ToString();
                this.Denounce3.Text = Labels.DailySummaryDenounce3;
                this.Denounce4.Text = (Current.Instance.Lands.Count(x => x.DemandAuthorities == true)).ToString() + ".";
                this.Denounce5.Text = Labels.DailySummaryDenounce5;

                //Verificar (Segundo Punto)
                this.Verify.Text = Labels.DailySummaryVerify;
                this.Verify1.Text = Labels.DailySummaryVerify1;
                this.Verify2.Text = (ewScores.Where(x => x.RegionId == Current.Instance.Earthwatcher.PlayingRegion).Count(x => x.Action == ActionPoints.Action.ConfirmationAdded.ToString())).ToString();
                this.Verify3.Text = Labels.DailySummaryVerify3;
                this.Verify4.Text = (Current.Instance.Lands.Count(x => x.LandStatus == LandStatus.Ok || x.LandStatus == LandStatus.Alert)).ToString() + ".";
                this.Verify5.Text = Labels.DailySummaryVerify5;

                //Reportar (Tercer Punto)
                this.Report.Text = Labels.DailySummaryReport;
                this.Report1.Text = Labels.DailySummaryReport1;
                this.Report2.Text = (ewScores.Where(x => x.RegionId == Current.Instance.Earthwatcher.PlayingRegion).Count(x => x.Action == ActionPoints.Action.LandStatusChanged.ToString())).ToString();
                this.Report3.Text = Labels.DailySummaryReport3;

                //Compartir (Cuarto Punto)
                this.Share.Text = Labels.DailySummaryShare;
                this.Share1.Text = Labels.DailySummaryShare1;
                this.Share2.Text = (ewScores.Where(x => x.RegionId == Current.Instance.Earthwatcher.PlayingRegion).Count(x => x.Action == ActionPoints.Action.Shared.ToString())).ToString();
                this.Share3.Text = Labels.DailySummaryShare3;

                //Percentaje (Ultimo punto)
                if(percentage != null)
                {
                    this.Presicion.Text = percentage.ToString();
                    PrecisionStackPanel.Visibility = Visibility.Visible;
                }
                else
                {
                    this.Presicion.Text = "0";
                    PrecisionStackPanel.Visibility = Visibility.Collapsed;
                }

                this.Remember.Text = Labels.DailySummaryRemember;
                this.Contest.Text = contestText;
            }
        }