Ejemplo n.º 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);
            };
        }
        public DungeonSettingsViewModel(DungeonsUserData userData, IDungeonsController controller)
        {
            this.UserData = userData;
            this.controller = controller;
            this.ResetAllTimesCommand = new DelegateCommand(this.ResetAllBestTimes);

            this.Dungeons = new ObservableCollection<DungeonViewModel>();
            foreach (var dungeon in this.controller.Dungeons)
            {
                // Exclude fractals
                if (dungeon.DungeonId != DungeonID.FractalsOfTheMists)
                    this.Dungeons.Add(dungeon);
            }
        }
Ejemplo n.º 3
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();
        }
Ejemplo n.º 4
0
        public DungeonSettingsViewModel(DungeonsUserData userData, IDungeonsController controller)
        {
            this.UserData             = userData;
            this.controller           = controller;
            this.ResetAllTimesCommand = new DelegateCommand(this.ResetAllBestTimes);

            this.Dungeons = new ObservableCollection <DungeonViewModel>();
            foreach (var dungeon in this.controller.Dungeons)
            {
                // Exclude fractals
                if (dungeon.DungeonId != DungeonID.FractalsOfTheMists)
                {
                    this.Dungeons.Add(dungeon);
                }
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="dungeonsController">The dungeons controller</param>
        public DungeonTrackerView(IDungeonsController dungeonsController)
        {
            logger.Debug("New DungeonTrackerView created");
            this.controller  = dungeonsController;
            this.viewModel   = new DungeonTrackerViewModel(this.controller);
            this.DataContext = this.viewModel;
            InitializeComponent();

            // Save the height values for use when collapsing the window
            this.MinHeight = minHeight;
            this.MaxHeight = maxHeight;
            this.Height    = Properties.Settings.Default.DungeonTrackerHeight;

            this.Closing += DungeonTrackerView_Closing;
            this.beforeCollapseHeight = this.Height;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Notifies the module that it has be initialized.
        /// </summary>
        public void Initialize()
        {
            logger.Debug("Initializing Dungeons Module");

            this.dungeonsController = this.container.GetExportedValue <IDungeonsController>();
            this.viewController     = this.container.GetExportedValue <IDungeonsViewController>();

            // Register for shutdown
            Commands.ApplicationShutdownCommand.RegisterCommand(new DelegateCommand(this.Shutdown));

            // Get the dungeons controller started
            this.dungeonsController.Start();

            // Initialize the view controller
            this.viewController.Initialize();

            logger.Debug("Dungeons Module initialized");
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Notifies the module that it has be initialized.
        /// </summary>
        public void Initialize()
        {
            logger.Debug("Initializing Dungeons Module");

            this.dungeonsController = this.container.GetExportedValue<IDungeonsController>();
            this.viewController = this.container.GetExportedValue<IDungeonsViewController>();

            // Register for shutdown
            Commands.ApplicationShutdownCommand.RegisterCommand(new DelegateCommand(this.Shutdown));

            // Get the dungeons controller started
            this.dungeonsController.Start();

            // Initialize the view controller
            this.viewController.Initialize();

            logger.Debug("Dungeons Module initialized");
        }
Ejemplo n.º 8
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);
                };
        }
Ejemplo n.º 9
0
 public DungeonTrackerViewModel(IDungeonsController dungeonsController)
 {
     this.controller = dungeonsController;
 }
Ejemplo n.º 10
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();
        }
Ejemplo n.º 11
0
 public DungeonTrackerViewModel(IDungeonsController dungeonsController)
 {
     this.controller = dungeonsController;
 }