Пример #1
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="path"></param>
        /// <param name="userData"></param>
        public PathViewModel(DungeonPath path, IDungeonsController dungeonController, IWebBrowserController browserController, DungeonsUserData userData)
        {
            this.PathModel         = path;
            this.userData          = userData;
            this.dungeonController = dungeonController;
            this.browserController = browserController;

            this.OpenGuideCommand       = new DelegateCommand(this.OpenGuide);
            this.SetAsActivePathCommand = new DelegateCommand(this.SetAsActivePath);
            this.RemoveTimesCommand     = new DelegateCommand <object>(this.RemoveCompletionTimes);

            // Initialize the path completion data in the UserData object
            var existingPathCompletionData = this.userData.PathCompletionData.FirstOrDefault(pt => pt.PathID == this.PathId);

            if (existingPathCompletionData != null)
            {
                existingPathCompletionData.PathData = this;
            }
            else
            {
                this.userData.PathCompletionData.Add(new PathCompletionData(this));
            }

            this.CompletionTimes.CollectionChanged += (o, e) =>
            {
                this.OnPropertyChanged(() => this.BestCompletionTime);
                this.OnPropertyChanged(() => this.AverageCompletionTime);
            };
        }
Пример #2
0
        public DungeonsController(IDungeonsService dungeonsService, IZoneService zoneService, IPlayerService playerService, IWebBrowserController browserController, DungeonsUserData userData)
        {
            logger.Debug("Initializing Dungeons Controller");
            this.dungeonsService     = dungeonsService;
            this.zoneService         = zoneService;
            this.playerService       = playerService;
            this.browserController   = browserController;
            this.userData            = userData;
            this.isStopped           = false;
            this.tickStopped         = false;
            this.currentRunTimeSaved = false;

            // Initialize the dungeon timer view model
            this.DungeonTimerData = new DungeonTimerViewModel(userData);

            // Initialize the refresh timer
            this.dungeonsRefreshTimer = new Timer(this.Refresh);
            this.RefreshInterval      = 250;

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

            // Initialize the dungeons
            this.InitializeDungeons();

            // This takes a while, so do it on a background thread
            Task.Factory.StartNew(() =>
            {
                this.InitializeDungeonZoneNames();
            });

            logger.Info("Dungeons Controller initialized");
        }
Пример #3
0
        /// <summary>
        /// Notifies the module that it has be initialized.
        /// </summary>
        public void Initialize()
        {
            logger.Debug("Initializing Web Browser Module");

            this.webBrowserController = this.Container.GetExportedValue<IWebBrowserController>();

            // Register for shutdown
            Commands.ApplicationShutdownCommand.RegisterCommand(new DelegateCommand(this.Shutdown));
#if NO_BROWSER
            logger.Debug("Web Browser Module initialization skipped");
#else
            // Initialize the WebCore for the web browser
            logger.Debug("Initializing Awesomium WebCore");
            if (!WebCore.IsInitialized)
            {
                WebCore.Initialize(new WebConfig()
                {
                    HomeURL = "http://wiki.guildwars2.com/".ToUri(),
                });
            }

            logger.Debug("Web Browser Module initialized");
#endif
        }
Пример #4
0
        /// <summary>
        /// Notifies the module that it has be initialized.
        /// </summary>
        public void Initialize()
        {
            logger.Debug("Initializing Web Browser Module");

            this.webBrowserController = this.Container.GetExportedValue <IWebBrowserController>();

            // Register for shutdown
            Commands.ApplicationShutdownCommand.RegisterCommand(new DelegateCommand(this.Shutdown));
#if NO_BROWSER
            logger.Debug("Web Browser Module initialization skipped");
#else
            // Initialize the WebCore for the web browser
            logger.Debug("Initializing Awesomium WebCore");
            if (!WebCore.IsInitialized)
            {
                WebCore.Initialize(new WebConfig()
                {
                    HomeURL = "http://wiki.guildwars2.com/".ToUri(),
                });
            }

            logger.Debug("Web Browser Module initialized");
#endif
        }
Пример #5
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="path"></param>
        /// <param name="userData"></param>
        public PathViewModel(DungeonPath path, IDungeonsController dungeonController, IWebBrowserController browserController, DungeonsUserData userData)
        {
            this.PathModel = path;
            this.userData = userData;
            this.dungeonController = dungeonController;
            this.browserController = browserController;

            this.OpenGuideCommand = new DelegateCommand(this.OpenGuide);
            this.SetAsActivePathCommand = new DelegateCommand(this.SetAsActivePath);
            this.RemoveTimesCommand = new DelegateCommand<object>(this.RemoveCompletionTimes);

            // Initialize the path completion data in the UserData object
            var existingPathCompletionData = this.userData.PathCompletionData.FirstOrDefault(pt => pt.PathID == this.PathId);
            if (existingPathCompletionData != null)
            {
                existingPathCompletionData.PathData = this;
            }
            else
            {
                this.userData.PathCompletionData.Add(new PathCompletionData(this));
            }

            this.CompletionTimes.CollectionChanged += (o, e) =>
                {
                    this.OnPropertyChanged(() => this.BestCompletionTime);
                    this.OnPropertyChanged(() => this.AverageCompletionTime);
                };
        }
Пример #6
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="dungeon">The dungeon information</param>
        /// <param name="dungeonsController">The dungeons controller</param>
        /// <param name="browserController">The browser controller object for displaying wiki information</param>
        /// <param name="userData">The dungeon user settings</param>
        public DungeonViewModel(GW2PAO.API.Data.Entities.Dungeon dungeon, IDungeonsController dungeonsController, IWebBrowserController browserController, DungeonsUserData userData)
        {
            this.DungeonModel = dungeon;
            this.userData     = userData;

            // Initialize the path view models
            this.Paths = new ObservableCollection <PathViewModel>();
            foreach (var path in this.DungeonModel.Paths)
            {
                this.Paths.Add(new PathViewModel(path, dungeonsController, browserController, this.userData));
            }

            this.RefreshVisibility();
            this.userData.PropertyChanged += (o, e) => this.RefreshVisibility();
            this.userData.HiddenDungeons.CollectionChanged += (o, e) => this.RefreshVisibility();
        }
Пример #7
0
 public WebBrowserMenu(IWebBrowserController controller)
 {
     // The only option is to open the web browser, which is this menu item itself
     this.OnClickCommand = new DelegateCommand(controller.OpenBrowser, () => { return(true); });
 }
Пример #8
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="dungeon">The dungeon information</param>
        /// <param name="dungeonsController">The dungeons controller</param>
        /// <param name="browserController">The browser controller object for displaying wiki information</param>
        /// <param name="userData">The dungeon user settings</param>
        public DungeonViewModel(GW2PAO.API.Data.Entities.Dungeon dungeon, IDungeonsController dungeonsController, IWebBrowserController browserController, DungeonsUserData userData)
        {
            this.DungeonModel = dungeon;
            this.userData = userData;

            // Initialize the path view models
            this.Paths = new ObservableCollection<PathViewModel>();
            foreach (var path in this.DungeonModel.Paths)
            {
                this.Paths.Add(new PathViewModel(path, dungeonsController, browserController, this.userData));
            }

            this.RefreshVisibility();
            this.userData.PropertyChanged += (o, e) => this.RefreshVisibility();
            this.userData.HiddenDungeons.CollectionChanged += (o, e) => this.RefreshVisibility();
        }
Пример #9
0
        public DungeonsController(IDungeonsService dungeonsService, IZoneService zoneService, IPlayerService playerService, IWebBrowserController browserController, DungeonsUserData userData)
        {
            logger.Debug("Initializing Dungeons Controller");
            this.dungeonsService = dungeonsService;
            this.zoneService = zoneService;
            this.playerService = playerService;
            this.browserController = browserController;
            this.userData = userData;
            this.isStopped = false;
            this.tickStopped = false;
            this.currentRunTimeSaved = false;

            // Initialize the dungeon timer view model
            this.DungeonTimerData = new DungeonTimerViewModel(userData);

            // Initialize the refresh timer
            this.dungeonsRefreshTimer = new Timer(this.Refresh);
            this.RefreshInterval = 250;

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

            // Initialize the dungeons
            this.InitializeDungeons();

            // This takes a while, so do it on a background thread
            Task.Factory.StartNew(() =>
                {
                    this.InitializeDungeonZoneNames();
                });

            logger.Info("Dungeons Controller initialized");
        }
Пример #10
0
 public WebBrowserMenu(IWebBrowserController controller)
 {
     // The only option is to open the web browser, which is this menu item itself
     this.OnClickCommand = new DelegateCommand(controller.OpenBrowser, () => { return true; });
 }