Example #1
0
        private bool UpdateBuilders()
        {
            ServiceBuilder serviceBuilderEdit = serviceBuilder.Clone();
            HotKeysBuilder hotKeysBuilderEdit = hotKeysBuilder.Clone();

            if (viewModel?.Service?.AudioService != null)
            {
                serviceBuilderEdit.WithService(viewModel.Service.AudioService);
            }
            if (viewModel?.Service?.Communicator != null)
            {
                serviceBuilderEdit.WithCommunicator(viewModel.Service.Communicator);
            }
            if (hotKeys != null)
            {
                hotKeysBuilderEdit.WithHotKeys(hotKeys);
            }

            SettingsWindow window = new SettingsWindow(serviceBuilderEdit, hotKeysBuilderEdit);

            if (window.ShowDialog() != true)
            {
                return(false);
            }

            serviceBuilder = serviceBuilderEdit;
            hotKeysBuilder = hotKeysBuilderEdit;
            return(true);
        }