예제 #1
0
        private void UpdateSettings()
        {
            var length = (int)sldLength.Value;

            var characters = _checks
                .Where(x => x.IsChecked != null &&
                    x.IsChecked.Value)
                .SelectMany(x => x.Characters)
                .ToArray();

            var results = new GenerationResults(
                characters, length);

            lstResults.ItemsSource = results;
        }
예제 #2
0
        private void UpdateSettings()
        {
            var dispatcher = Dispatcher;

            dispatcher.BeginInvoke(() =>
            {
                var length = (int)sldLength.Value;

                var characters = _checks
                    .Where(x => x.IsChecked != null &&
                        x.IsChecked.Value)
                    .SelectMany(x => x.Characters)
                    .ToArray();

                ThreadPool.QueueUserWorkItem(_ =>
                {
                    var results = new GenerationResults(
                        characters, length);

                    dispatcher.BeginInvoke(() =>
                        lstResults.ItemsSource = results);
                });
            });
        }