Example #1
0
        public MainWindow()
        {
            ValidateWindowPositionAndSize();

            arkReader = new ArkReader();

            appVersion = CalculateApplicationVersion();
            IsDevMode  = (appVersion == DEV_STRING);

            LoadCalibrations();
            DiscoverCalibration();

            DataContext     = this;
            this.MouseDown += new MouseButtonEventHandler(window_MouseDown);

            InitializeComponent();

            Dispatcher.Invoke(async() => {
                await Task.Yield();
                Properties.Settings.Default.MainWindowWidth = CalculateWidthFromHeight((int)Math.Round(Properties.Settings.Default.MainWindowHeight));
            }, DispatcherPriority.Loaded);

            LoadSavedSearches();
            SetupFileWatcher();

            var cmdThrowExceptionAndExit = new RoutedCommand();

            cmdThrowExceptionAndExit.InputGestures.Add(new KeyGesture(Key.F2, ModifierKeys.Control));
            CommandBindings.Add(new CommandBinding(cmdThrowExceptionAndExit, (o, e) => Dev_GenerateException_Click(null, null)));

            DependencyPropertyDescriptor.FromProperty(SearchTextProperty, typeof(MainWindow)).AddValueChanged(DataContext, (s, e) => TriggerNameSearch());
        }
Example #2
0
        public MainWindow()
        {
            ValidateWindowPositionAndSize();

            arkReaderWild  = new ArkReader(true);
            arkReaderTamed = new ArkReader(false);

            appVersion = CalculateApplicationVersion();

            LoadCalibrations();
            DiscoverCalibration();

            DataContext = this;

            InitializeComponent();

            devButtons.Visibility = (ApplicationVersion == DEV_STRING) ? Visibility.Visible : Visibility.Collapsed;
            Dispatcher.Invoke(async() =>
            {
                await Task.Yield();
                Properties.Settings.Default.MainWindowWidth = CalculateWidthFromHeight((int)Math.Round(Properties.Settings.Default.MainWindowHeight));
            }, DispatcherPriority.Loaded);

            LoadSavedSearches();
            EnsureOutputDirectory();
            SetupFileWatcher();
            CheckIfArkChanged(false);

            var cmdThrowExceptionAndExit = new RoutedCommand();

            cmdThrowExceptionAndExit.InputGestures.Add(new KeyGesture(Key.F2, ModifierKeys.Control));
            CommandBindings.Add(new CommandBinding(cmdThrowExceptionAndExit, (o, e) => Dev_GenerateException_Click(null, null)));

            DependencyPropertyDescriptor.FromProperty(SearchTextProperty, typeof(MainWindow)).AddValueChanged(DataContext, (s, e) => TriggerNameSearch());
        }
Example #3
0
        public MainWindow()
        {
            ValidateWindowPositionAndSize();

            arkReaderWild  = new ArkReader(true);
            arkReaderTamed = new ArkReader(false);

            LoadCalibrations();
            DiscoverCalibration();

            DataContext = this;

            InitializeComponent();

            devButtons.Visibility = (ApplicationVersion == "DEVELOPMENT") ? Visibility.Visible : Visibility.Collapsed;

            LoadSavedSearches();
            EnsureOutputDirectory();
            SetupFileWatcher();
            CheckIfArkChanged(false);

            // Sort the results
            resultsList.Items.SortDescriptions.Add(new SortDescription("Dino.BaseLevel", ListSortDirection.Descending));

            // Sort the searches
            searchesList.Items.SortDescriptions.Add(new SortDescription("Group", ListSortDirection.Ascending));
            searchesList.Items.SortDescriptions.Add(new SortDescription("Order", ListSortDirection.Ascending));

            // Add grouping to the searches list
            CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(searchesList.ItemsSource);

            view.GroupDescriptions.Add(new PropertyGroupDescription("Group"));
        }
Example #4
0
        private async Task UpdateArkToolsData()
        {
            StatusText = "Updating ark-tools database";
            try
            {
                await ArkReader.ExecuteArkTools("update-data");

                StatusText = "Updated ark-tools database";
            }
            catch (Exception e)
            {
                StatusText = "Failed to update ark-tools database: " + e.Message;
            }
        }