Пример #1
0
        public MainWindow()
        {
            instance = this;
            //Properties.Settings.Default.Reset();
            InitializeComponent();
            DataContext = this;
            NETAutoupdater.InitializeAutoupdater(appVersion);

            //Data.InitializeBases();
            if (!string.IsNullOrEmpty(Settings.Default.FilterChangeSoundFileLocation) && !FilterSoundLocationDialog.Content.Equals("Default Sound"))
            {
                Data.Player.Open(new Uri(Settings.Default.FilterChangeSoundFileLocation));
            }
            else
            {
                //Data.Player.Open(new Uri(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"ChaosRecipeEnhancer\Sounds\filterchanged.mp3")));
                Data.Player.Open(new Uri(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Sounds\filterchanged.mp3")));
            }

            if (!string.IsNullOrEmpty(Settings.Default.ItemPickupSoundFileLocation) && !ItemPickupLocationDialog.Content.Equals("Default Sound"))
            {
                Data.PlayerSet.Open(new Uri(Settings.Default.ItemPickupSoundFileLocation));
            }
            else
            {
                //Data.PlayerSet.Open(new Uri(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"ChaosRecipeEnhancer\Sounds\itemsPickedUp.mp3")));
                Data.PlayerSet.Open(new Uri(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Sounds\itemsPickedUp.mp3")));
            }

            //TESTING SETTINGS RESET
            //if (Debugger.IsAttached)
            //    Properties.Settings.Default.Reset();

            // initialize stashtabs
            //DataContext = stashTabsModel;

            InitializeColors();
            InitializeHotkeys();
            InitializeTray();
            LoadModeVisibility();
            // add Action to MouseHook
            MouseHook.MouseAction += Coordinates.Event;

            //throw new NullReferenceException();
        }
Пример #2
0
        public MainWindow()
        {
            InitializeComponent();
            DataContext = this;
            NETAutoupdater.InitializeAutoupdater(AppVersion);

            if (!string.IsNullOrEmpty(Settings.Default.FilterChangeSoundFileLocation) && !FilterSoundLocationDialog.Content.Equals("Default Sound"))
            {
                Data.Player.Open(new Uri(Settings.Default.FilterChangeSoundFileLocation));
            }
            else
            {
                Data.Player.Open(new Uri(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Sounds\filterchanged.mp3")));
            }

            if (!string.IsNullOrEmpty(Settings.Default.ItemPickupSoundFileLocation) && !ItemPickupLocationDialog.Content.Equals("Default Sound"))
            {
                Data.PlayerSet.Open(new Uri(Settings.Default.ItemPickupSoundFileLocation));
            }
            else
            {
                Data.PlayerSet.Open(new Uri(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Sounds\itemsPickedUp.mp3")));
            }

            //TESTING SETTINGS RESET
            //if (Debugger.IsAttached)
            //    Properties.Settings.Default.Reset();

            // initialize stash tabs
            //DataContext = stashTabsModel;

            // Populate the league dropdown
            if (Settings.Default.MainLeague)
            {
                MainLeagueComboBox.ItemsSource = ApiAdapter.GetAllLeagueNames();
            }

            InitializeColors();
            InitializeHotkeys();
            InitializeTray();
            LoadModeVisibility();

            // add Action to MouseHook
            MouseHook.MouseAction += Coordinates.Event;
        }