コード例 #1
0
ファイル: WvWMenu.cs プロジェクト: reecebedding/gw2pao
        public WvWMenu(IWvWViewController viewFactory, IWvWService wvwService, WvWUserData userData)
        {
            // Build up the sub menu items
            this.SubMenuItems = new ObservableCollection<IMenuItem>();

            // WvW Tracker
            this.SubMenuItems.Add(new MenuItem(Properties.Resources.OpenWvWTracker, viewFactory.DisplayWvWTracker, viewFactory.CanDisplayWvWTracker));
            this.SubMenuItems.Add(new CheckableMenuItem(Properties.Resources.WvWNotifications, false, () => userData.AreNotificationsEnabled, userData));
            this.SubMenuItems.Add(new MenuItem(Properties.Resources.Configure, () => Commands.OpenWvWSettingsCommand.Execute(null)));
        }
コード例 #2
0
        public WvWSettingsViewModel(WvWUserData userData, IWvWService wvwService)
        {
            this.UserData = userData;
            this.PossibleWorlds = new ObservableCollection<World>();

            Task.Factory.StartNew(() =>
                {
                    if (wvwService.Worlds == null || wvwService.Worlds.Count == 0)
                        wvwService.LoadData();
                    foreach (var world in wvwService.Worlds.OrderBy(wld => wld.Name))
                    {
                        Threading.BeginInvokeOnUI(() => this.PossibleWorlds.Add(world));
                    }
                });
        }
コード例 #3
0
        public WvWSettingsViewModel(WvWUserData userData, IWvWService wvwService)
        {
            this.UserData       = userData;
            this.PossibleWorlds = new ObservableCollection <World>();

            Task.Factory.StartNew(() =>
            {
                if (wvwService.Worlds == null || wvwService.Worlds.Count == 0)
                {
                    wvwService.LoadData();
                }
                foreach (var world in wvwService.Worlds.OrderBy(wld => wld.Name))
                {
                    Threading.BeginInvokeOnUI(() => this.PossibleWorlds.Add(world));
                }
            });
        }
コード例 #4
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="objective">The objective details</param>
        /// <param name="wvwTeams">Collection containing all of the WvW Teams</param>
        public WvWObjectiveViewModel(WvWObjective objective, WvWUserData userData, ICollection <WvWTeamViewModel> wvwTeams, ICollection <WvWObjectiveViewModel> displayedNotificationsCollection)
        {
            this.ModelData = objective;
            this.userData  = userData;
            this.wvwTeams  = wvwTeams;
            this.displayedNotificationsCollection = displayedNotificationsCollection;

            this.PrevWorldOwner         = WorldColor.None;
            this.FlipTime               = DateTime.UtcNow;
            this.TimerValue             = TimeSpan.Zero;
            this.DistanceFromPlayer     = 0.0;
            this.IsRIActive             = false;
            this.IsNotificationShown    = false;
            this.IsRemovingNotification = false;
            this.GuildClaimer           = new GuildViewModel();

            this.userData.PropertyChanged += (o, e) => this.RefreshVisibility();
            this.userData.HiddenObjectives.CollectionChanged += (o, e) => this.RefreshVisibility();
            this.RefreshVisibility();
        }
コード例 #5
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="objective">The objective details</param>
        /// <param name="wvwTeams">Collection containing all of the WvW Teams</param>
        public WvWObjectiveViewModel(WvWObjective objective, WvWUserData userData, IEnumerable<WvWTeamViewModel> wvwTeams, ICollection<WvWObjectiveViewModel> displayedNotificationsCollection)
        {
            this.ModelData = objective;
            this.userData = userData;
            this.wvwTeams = wvwTeams;
            this.displayedNotificationsCollection = displayedNotificationsCollection;

            this.PrevWorldOwner = WorldColor.None;
            this.FlipTime = DateTime.UtcNow;
            this.TimerValue = TimeSpan.Zero;
            this.DistanceFromPlayer = 0.0;
            this.IsRIActive = false;
            this.IsNotificationShown = false;
            this.IsRemovingNotification = false;
            this.GuildClaimer = new GuildViewModel();

            this.userData.PropertyChanged += (o, e) => this.RefreshVisibility();
            this.userData.HiddenObjectives.CollectionChanged += (o, e) => this.RefreshVisibility();
            this.RefreshVisibility();
        }
コード例 #6
0
ファイル: WvWController.cs プロジェクト: SalifovEA/gw2pao
        public WvWController(IWvWService wvwService, IPlayerService playerService, IHasWvWMap hasMap, IGuildService guildService, WvWUserData userData)
        {
            logger.Debug("Initializing WvW Controller");
            this.wvwService = wvwService;
            this.playerService = playerService;
            this.guildService = guildService;
            this.currentMap = hasMap;
            this.userData = userData;
            this.timerCount = 0;
            this.isStopped = false;

            // Initialize the refresh timer
            this.objectivesRefreshTimer = new Timer(this.Refresh);
            this.ObjectivesRefreshInterval = 500;

            // Initialize the start call count to 0
            this.startCallCount = 0;

            // Initialize the collections, but do it on a seperate thread since it can take a little time
            logger.Info("WvW Controller initialized");
        }