コード例 #1
0
 public CyclesMenu(ICyclesViewController viewFactory, CyclesUserData userData)
 {
     this.SubMenuItems = new ObservableCollection <IMenuItem>();
     this.SubMenuItems.Add(new MenuItem(Properties.Resources.OpenCyclesTracker, viewFactory.DisplayCyclesTracker, viewFactory.CanDisplayCyclesTracker));
     this.SubMenuItems.Add(new CheckableMenuItem(Properties.Resources.CycleNotifications, false, () => userData.AreCycleNotificationsEnabled, userData));
     this.SubMenuItems.Add(new MenuItem(Properties.Resources.Configure, () => Commands.OpenCycleSettingsCommand.Execute(null)));
 }
コード例 #2
0
        public CyclesController(ICyclesService cyclesService, IZoneService zoneService, IPlayerService playerService, CyclesUserData userData)
        {
            logger.Debug("Initializing Cycle Tracker Controller");
            this.cyclesService = cyclesService;
            this.zoneService   = zoneService;
            this.playerService = playerService;
            this.isStopped     = false;

            this.userData = userData;

            // Initialize the refresh timer
            this.cycleRefreshTimer    = new Timer(this.RefreshCycles);
            this.CycleRefreshInterval = 1000;

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

            // Set up handling of the cycle settings UseAdjustedTable property changed so that we can load the correct table when it changes
            this.UserData.PropertyChanged += UserData_PropertyChanged;

            // Initialize the WorldCycles collection
            this.InitializeCycles();

            // Do this on a background thread since it takes awhile
            Task.Factory.StartNew(this.InitializeCycleZoneNames);

            logger.Info("Cycle Tracker Controller initialized");
        }
コード例 #3
0
        /// <summary>
        /// Performs all neccesary shutdown activities for this module
        /// </summary>
        private void Shutdown()
        {
            logger.Debug("Shutting down Cycles Module");

            // Shut down the commerce controller
            this.cyclesController.Shutdown();

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

            // Make sure we have saved all user data
            // Note that this is a little redundant given the AutoSave feature,
            // but it does help to make sure the user's data is really saved
            CyclesUserData.SaveData(this.UserData, CyclesUserData.Filename);
        }