private void Refresh() { if (Project == null) { return; } var selectedIndex = FolderListBox.SelectedIndex; FolderListBox.Items.Clear(); SynchronizeOutputCheckBox.IsChecked = FolderSynchronizationManager.GetSynchronizeOutputFolderOnBuild(Project); foreach (var source in FolderSynchronizationManager.Folders.Where(f => f.Project == Project)) { FolderListBox.Items.Add(source); } if (selectedIndex >= FolderListBox.Items.Count) { selectedIndex = FolderListBox.Items.Count - 1; } FolderListBox.SelectedIndex = selectedIndex; }
private void SetProjectSynchronization([NotNull] object sender, [NotNull] RoutedEventArgs e) { Debug.ArgumentNotNull(sender, nameof(sender)); Debug.ArgumentNotNull(e, nameof(e)); if (Project == null) { return; } FolderSynchronizationManager.SetSynchronizeOutputFolderOnBuild(Project, SynchronizeOutputCheckBox.IsChecked == true); }
private void Remove([NotNull] object sender, [NotNull] RoutedEventArgs e) { Debug.ArgumentNotNull(sender, nameof(sender)); Debug.ArgumentNotNull(e, nameof(e)); var selectedItem = FolderListBox.RemoveSelectedItem() as FolderSynchronizer; if (selectedItem == null) { return; } FolderSynchronizationManager.Remove(Project, selectedItem); }