Esempio n. 1
0
        public MapObjectiveItem(Model.API.objective oObjective, List <Model.XML.Objective> oLstObjectives, Model.API.matches_match oMatch, LogWriter oLogWriter)
        {
            InitializeComponent();

            Objective        = oObjective;
            m_oLstObjectives = oLstObjectives;
            m_oMatch         = oMatch;
            m_oLogWriter     = oLogWriter;

            Init();
        }
Esempio n. 2
0
        /// <summary>
        /// Update die Ansicht
        /// </summary>
        /// <param name="oObjective"></param>
        public void Update(Model.API.objective oObjective)
        {
            Model.XML.Objective oObjectiveInList;

            try
            {
                oObjectiveInList = m_oLstObjectives.Find(x => x.Id == Objective.id);

                if (oObjectiveInList != null)
                {
                    TimeHeld     = oObjective.time_held;
                    Ri_Remaining = oObjective.ri_remaining;

                    labelTimeOwned.Content = GetTimeOwnedString();

                    Objective.current_guild    = oObjective.current_guild;
                    imageGuildClaim.Visibility = oObjective.current_guild == null || string.IsNullOrWhiteSpace(oObjective.current_guild.id) ? System.Windows.Visibility.Hidden : System.Windows.Visibility.Visible;

                    if (Objective.current_owner.world_id != oObjective.current_owner.world_id)
                    {
                        Objective = oObjective;
                        this.SetEffect(Brushes.Red);

                        imageObjectiveType.Source = new BitmapImage(this.GetIconUri(oObjectiveInList, Objective.current_owner.color));


                        if (Objective.ri_remaining.TotalMilliseconds > 0)
                        {
                            if (!string.IsNullOrWhiteSpace(labelTimer.Content.ToString()))
                            {
                                m_oTimer.Stop();
                            }
                            imageBlock.Visibility = System.Windows.Visibility.Visible;
                            Countdown((int)Objective.ri_remaining.TotalSeconds, TimeSpan.FromSeconds(1), cur => labelTimer.Content = string.Format("{0:%m}:{0:ss}", new TimeSpan(0, 0, cur)));
                        }
                    }
                }
            }
            catch (Exception oEx)
            {
                m_oLogWriter.WriteMessage(oEx.ToString(), LogWriter.MESSAGE_TYPE.Error);
            }
        }
Esempio n. 3
0
 public ObjectiveItemDoubleclickEventArgs(Model.API.objective oObjective, TimeSpan oRemaining, TimeSpan oTimeHeld)
 {
     Objective    = oObjective;
     Ri_Remaining = oRemaining;
     Time_Held    = oTimeHeld;
 }