diff --git a/.vs/DataOrganizer/v16/.suo b/.vs/DataOrganizer/v16/.suo index 59fd2b4..608bdce 100644 Binary files a/.vs/DataOrganizer/v16/.suo and b/.vs/DataOrganizer/v16/.suo differ diff --git a/DataOrganizer/FileViewer.Designer.cs b/DataOrganizer/FileViewer.Designer.cs index 835bf0e..f37b1fc 100644 --- a/DataOrganizer/FileViewer.Designer.cs +++ b/DataOrganizer/FileViewer.Designer.cs @@ -204,6 +204,7 @@ this.Controls.Add(this.MainMenu); this.MainMenuStrip = this.MainMenu; this.Name = "FileViewer"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "File Viewer & Comparison"; this.tableLayoutPanel1.ResumeLayout(false); this.PanelOne.ResumeLayout(false); diff --git a/DataOrganizer/MainForm.Designer.cs b/DataOrganizer/MainForm.Designer.cs index fc6b29c..b893689 100644 --- a/DataOrganizer/MainForm.Designer.cs +++ b/DataOrganizer/MainForm.Designer.cs @@ -94,6 +94,7 @@ this.Controls.Add(this.MainMenu); this.MainMenuStrip = this.MainMenu; this.Name = "MainForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Form1"; this.MainMenu.ResumeLayout(false); this.MainMenu.PerformLayout(); diff --git a/DataOrganizer/ProfileManager.Designer.cs b/DataOrganizer/ProfileManager.Designer.cs index 78aa831..32c5760 100644 --- a/DataOrganizer/ProfileManager.Designer.cs +++ b/DataOrganizer/ProfileManager.Designer.cs @@ -285,6 +285,7 @@ this.FolderGroupListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.NameColumn, this.PathColumn}); + this.FolderGroupListView.FullRowSelect = true; this.FolderGroupListView.HideSelection = false; this.FolderGroupListView.Location = new System.Drawing.Point(20, 407); this.FolderGroupListView.MultiSelect = false; @@ -316,7 +317,8 @@ this.MinimizeBox = false; this.Name = "ProfileManager"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.Text = "ProfileManager"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Profile Manager"; this.MainLayoutPanel.ResumeLayout(false); this.MainPanel.ResumeLayout(false); this.MainPanel.PerformLayout(); diff --git a/DataOrganizer/ProfileManager.cs b/DataOrganizer/ProfileManager.cs index 0640ed5..69d20d4 100644 --- a/DataOrganizer/ProfileManager.cs +++ b/DataOrganizer/ProfileManager.cs @@ -13,10 +13,10 @@ namespace DataOrganizer { public partial class ProfileManager : Form { - private string MachineNameLabelText { get; } = "The Machine Name property determines what\r\nprofile will be loaded automatically (Currently: '{0}')."; + private string MachineNameLabelText { get; } = "The Machine Name property determines what profile will be loaded automatically.\r\nCurrently: '{0}'."; private bool IsUpdating { get; set; } private ContextMenu FolderGroupListContextMenu { get; set; } = new ContextMenu(); - private TreeNode ClickedNode { get; set; } + private ListViewItem SelectedItem { get; set; } public ProfileManager() { @@ -29,20 +29,20 @@ namespace DataOrganizer ProfileNameTextBox.TextChanged += ToggleAddOrUpdateButton; NewContentLocationTextBox.TextChanged += ToggleAddOrUpdateButton; MachineNameTextBox.TextChanged += MachineNameTextBox_TextChanged; - //FolderGroupsTreeView.NodeMouseClick += FolderGroupsTreeView_NodeMouseClick; FolderGroupPathTextBox.TextChanged += ToggleGroupInsertButton; FolderGroupNameTextBox.TextChanged += ToggleGroupInsertButton; + FolderGroupListView.MouseClick += FolderGroupListView_MouseClick; deleteMenuItem.Click += DeleteMenuItem_Click; UpdateProfileComboBox(); } - private void FolderGroupsTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) + private void FolderGroupListView_MouseClick(object sender, MouseEventArgs e) { - if (e.Button == MouseButtons.Right) + if(e.Button == MouseButtons.Right) { - ClickedNode = e.Node; - //FolderGroupListContextMenu.Show(FolderGroupsTreeView, e.Location); + SelectedItem = FolderGroupListView.GetItemAt(e.X, e.Y); + FolderGroupListContextMenu.Show(FolderGroupListView, e.Location); } } @@ -57,7 +57,7 @@ namespace DataOrganizer var db = new DB(); var currentIndex = ProfilesComboBox.SelectedIndex; - db.DeleteFolderGroup((DB.FolderGroup) ClickedNode.Tag); + db.DeleteFolderGroup((DB.FolderGroup) SelectedItem.Tag); UpdateProfileComboBox(); @@ -67,10 +67,9 @@ namespace DataOrganizer else { FolderGroupListView.Items.Remove(FolderGroupListView.SelectedItems[0]); - //FolderGroupsTreeView.Nodes.Remove(ClickedNode); } - ClickedNode = null; + SelectedItem = null; } private void MachineNameTextBox_TextChanged(object sender, EventArgs e) @@ -199,6 +198,7 @@ namespace DataOrganizer { var item = new ListViewItem(group.Name); item.SubItems.Add(group.Path); + item.Tag = group; FolderGroupListView.Items.Add(item); }