From 73ede9e3677b7224c66f463607a18f7f73ae7ef2 Mon Sep 17 00:00:00 2001 From: Admin Date: Wed, 9 Dec 2020 19:09:34 -0600 Subject: [PATCH] Started work on a cleaner more focused file manager form. The form will only be used to diff profile group folders, other tasks will be reserved for future forms. --- .vs/DataOrganizer/v16/.suo | Bin 139776 -> 139776 bytes DataOrganizer/DataOrganizer.csproj | 13 ++ DataOrganizer/FileManager.Designer.cs | 274 ++++++++++++++++++++++++++ DataOrganizer/FileManager.cs | 193 ++++++++++++++++++ DataOrganizer/FileManager.resx | 123 ++++++++++++ DataOrganizer/MainForm.Designer.cs | 12 +- DataOrganizer/MainForm.cs | 6 + DataOrganizer/Snapshot.cs | 50 ++++- 8 files changed, 669 insertions(+), 2 deletions(-) create mode 100644 DataOrganizer/FileManager.Designer.cs create mode 100644 DataOrganizer/FileManager.cs create mode 100644 DataOrganizer/FileManager.resx diff --git a/.vs/DataOrganizer/v16/.suo b/.vs/DataOrganizer/v16/.suo index 16c6fa27b374a2cd9e8bb2fde1db8dae9f34f394..77deaaa88fe7f0712e2b4938424abab8662849fd 100644 GIT binary patch delta 7624 zcmZoT!qISqV}gMu69W_oFfa%+Fff4l|Nj5~4-#c&U|>*TU|^7CU|`Ui?8qv;v7m=> z5|a-j`(#BXdA0)|US>`>H@S$ZiE+*3uT1r9$_xw)o0uk7F<0^0F)%RP;RG4Nz`!+` zkwx0~KN8SpU|;}Q0uvHtU|;~TRT&u=gcukYlo=s>keE1BP7_L-F)%Q&OjcwS=imkz z&&a?qF;T|JfPsPG@Bjb*`Jk#mIu)R7bEq6h41`S?7#Q>z7#P?X7#JiO7#J)W7#KJi zCqH9RVsxI&$y)50z`($e$iTpm3^gEyfq@~Ffq@|%%Fke6V918DK?dd{v9~cWFcd=h z=RjdLu|NSHWSk2mcg~)0?i!=&86aVKoPmLXm4Sf)6j~tjWT0w5kptp`um~v385r!qK`76_z#t7( z#K6eFz|O$Hzz=nV8Uq8v8U_Xi4F(1V9jF>mu!9WIoxG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z+#!mQ5!CXQfHdhHq8VK#d-y=x@D4GIh$ejqmL~o512K$`SP_-_ffz;+Muy3O>AKV6 z7+I!2$Y-8zyy^9cj0w{{5*fv&J0vo4Z%bk_yv8!=#Fyz4S{b#$C8QvzGy!=6RHA~$ z9u%M@Ek8V%KI~r%9d$r23Xh73A*litm>vua3@%_N)lW7!y=wEklVOb0`&t<7Aq6G4 zc>=ag;s9va0>p$Cl%UeZaq@!)=O*7fBeD6`X*H(F2`6+m>s&a&1WK2Tkg&p1KEg|# z&0j9@FisZOm^QiZfz0Hl8zs}XI5B#_bMx{8eT9IH6PBDoJu6733R2I)#1Y9H*#KP0 z{5sCWd<^6pFjhK%J28V5Knc{uj9l466@V$w2q0(}6q<%XmAwrUq>3!aXOx?k&nULt zgNbPe^Yj~Sj5C=tQ_H8HFK2Y!zOR*0o^e_SqXVddha})h_o1!1$p`K`pj4n!wskYc zF)At@7ge&+thzRL#+*5&f?r;K{k67${oV_f2Zp9*{Jp8l44_f+>63aG^`@iLR@)0E zGAc1{|HsVa#0aSur#rAR9heSs;B+|!CL!?xhJ1!%h8PAHa5Fv;JPiQq!+y+Xw8X5J zCa^FWOg}J*ahamdndn1;oJlcT + + Form + + + FileManager.cs + Form @@ -106,6 +112,9 @@ + + FileManager.cs + FileViewer.cs @@ -149,4 +158,8 @@ + + + + \ No newline at end of file diff --git a/DataOrganizer/FileManager.Designer.cs b/DataOrganizer/FileManager.Designer.cs new file mode 100644 index 0000000..4143bab --- /dev/null +++ b/DataOrganizer/FileManager.Designer.cs @@ -0,0 +1,274 @@ +namespace DataOrganizer +{ + partial class FileManager + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.MainLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); + this.MainMenuStrip = new System.Windows.Forms.MenuStrip(); + this.SelectProfileComboBoxMainMenu = new System.Windows.Forms.ToolStripComboBox(); + this.ManageMainMenuStrip = new System.Windows.Forms.ToolStripMenuItem(); + this.ProfilesManageMainMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.NamingPatternsManageMainMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.SelectFolderGroupComboBoxMainMenu = new System.Windows.Forms.ToolStripComboBox(); + this.FolderGroupTreeView = new System.Windows.Forms.TreeView(); + this.DiffViewTreeView = new System.Windows.Forms.TreeView(); + this.Panel1 = new System.Windows.Forms.Panel(); + this.FileDetailsGroupBox = new System.Windows.Forms.GroupBox(); + this.DiffResultsGroupBox = new System.Windows.Forms.GroupBox(); + this.ScanSelectedFolderGroupButton = new System.Windows.Forms.Button(); + this.CompareAgainstGroupBox = new System.Windows.Forms.GroupBox(); + this.CompareAgainstProfileComboBox = new System.Windows.Forms.ComboBox(); + this.CompareAgainstFolderGroupComboBox = new System.Windows.Forms.ComboBox(); + this.CompareButton = new System.Windows.Forms.Button(); + this.MainLayoutPanel.SuspendLayout(); + this.MainMenuStrip.SuspendLayout(); + this.Panel1.SuspendLayout(); + this.CompareAgainstGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // MainLayoutPanel + // + this.MainLayoutPanel.ColumnCount = 3; + this.MainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F)); + this.MainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 34F)); + this.MainLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F)); + this.MainLayoutPanel.Controls.Add(this.MainMenuStrip, 0, 0); + this.MainLayoutPanel.Controls.Add(this.FolderGroupTreeView, 0, 2); + this.MainLayoutPanel.Controls.Add(this.DiffViewTreeView, 2, 2); + this.MainLayoutPanel.Controls.Add(this.Panel1, 0, 1); + this.MainLayoutPanel.Controls.Add(this.FileDetailsGroupBox, 1, 2); + this.MainLayoutPanel.Controls.Add(this.DiffResultsGroupBox, 1, 3); + this.MainLayoutPanel.Controls.Add(this.CompareAgainstGroupBox, 2, 1); + this.MainLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this.MainLayoutPanel.Location = new System.Drawing.Point(0, 0); + this.MainLayoutPanel.Name = "MainLayoutPanel"; + this.MainLayoutPanel.RowCount = 4; + this.MainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); + this.MainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.MainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40F)); + this.MainLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40F)); + this.MainLayoutPanel.Size = new System.Drawing.Size(1278, 844); + this.MainLayoutPanel.TabIndex = 0; + // + // MainMenuStrip + // + this.MainLayoutPanel.SetColumnSpan(this.MainMenuStrip, 3); + this.MainMenuStrip.GripMargin = new System.Windows.Forms.Padding(2, 2, 0, 2); + this.MainMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24); + this.MainMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.ManageMainMenuStrip, + this.SelectProfileComboBoxMainMenu, + this.SelectFolderGroupComboBoxMainMenu}); + this.MainMenuStrip.Location = new System.Drawing.Point(0, 0); + this.MainMenuStrip.Name = "MainMenuStrip"; + this.MainMenuStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; + this.MainMenuStrip.Size = new System.Drawing.Size(1278, 37); + this.MainMenuStrip.TabIndex = 0; + this.MainMenuStrip.Text = "menuStrip1"; + // + // SelectProfileComboBoxMainMenu + // + this.SelectProfileComboBoxMainMenu.BackColor = System.Drawing.Color.Gainsboro; + this.SelectProfileComboBoxMainMenu.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.SelectProfileComboBoxMainMenu.Name = "SelectProfileComboBoxMainMenu"; + this.SelectProfileComboBoxMainMenu.Size = new System.Drawing.Size(200, 33); + // + // ManageMainMenuStrip + // + this.ManageMainMenuStrip.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.ProfilesManageMainMenu, + this.NamingPatternsManageMainMenu}); + this.ManageMainMenuStrip.Name = "ManageMainMenuStrip"; + this.ManageMainMenuStrip.Size = new System.Drawing.Size(92, 33); + this.ManageMainMenuStrip.Text = "&Manage"; + // + // ProfilesManageMainMenu + // + this.ProfilesManageMainMenu.Name = "ProfilesManageMainMenu"; + this.ProfilesManageMainMenu.Size = new System.Drawing.Size(270, 34); + this.ProfilesManageMainMenu.Text = "&Profiles"; + this.ProfilesManageMainMenu.Click += new System.EventHandler(this.ProfilesManageMainMenu_Click); + // + // NamingPatternsManageMainMenu + // + this.NamingPatternsManageMainMenu.Name = "NamingPatternsManageMainMenu"; + this.NamingPatternsManageMainMenu.Size = new System.Drawing.Size(270, 34); + this.NamingPatternsManageMainMenu.Text = "&Naming Patterns"; + this.NamingPatternsManageMainMenu.Click += new System.EventHandler(this.NamingPatternsManageMainMenu_Click); + // + // SelectFolderGroupComboBoxMainMenu + // + this.SelectFolderGroupComboBoxMainMenu.BackColor = System.Drawing.Color.Gainsboro; + this.SelectFolderGroupComboBoxMainMenu.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.SelectFolderGroupComboBoxMainMenu.Name = "SelectFolderGroupComboBoxMainMenu"; + this.SelectFolderGroupComboBoxMainMenu.Size = new System.Drawing.Size(200, 33); + // + // FolderGroupTreeView + // + this.FolderGroupTreeView.BackColor = System.Drawing.Color.WhiteSmoke; + this.FolderGroupTreeView.Dock = System.Windows.Forms.DockStyle.Fill; + this.FolderGroupTreeView.FullRowSelect = true; + this.FolderGroupTreeView.Location = new System.Drawing.Point(3, 203); + this.FolderGroupTreeView.Name = "FolderGroupTreeView"; + this.MainLayoutPanel.SetRowSpan(this.FolderGroupTreeView, 2); + this.FolderGroupTreeView.ShowLines = false; + this.FolderGroupTreeView.Size = new System.Drawing.Size(415, 638); + this.FolderGroupTreeView.TabIndex = 1; + this.FolderGroupTreeView.TabStop = false; + // + // DiffViewTreeView + // + this.DiffViewTreeView.BackColor = System.Drawing.Color.WhiteSmoke; + this.DiffViewTreeView.Dock = System.Windows.Forms.DockStyle.Fill; + this.DiffViewTreeView.Location = new System.Drawing.Point(858, 203); + this.DiffViewTreeView.Name = "DiffViewTreeView"; + this.MainLayoutPanel.SetRowSpan(this.DiffViewTreeView, 2); + this.DiffViewTreeView.Size = new System.Drawing.Size(417, 638); + this.DiffViewTreeView.TabIndex = 2; + // + // Panel1 + // + this.Panel1.Controls.Add(this.ScanSelectedFolderGroupButton); + this.Panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.Panel1.Location = new System.Drawing.Point(3, 43); + this.Panel1.Name = "Panel1"; + this.Panel1.Size = new System.Drawing.Size(415, 154); + this.Panel1.TabIndex = 3; + // + // FileDetailsGroupBox + // + this.FileDetailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.FileDetailsGroupBox.Location = new System.Drawing.Point(424, 203); + this.FileDetailsGroupBox.Name = "FileDetailsGroupBox"; + this.FileDetailsGroupBox.Size = new System.Drawing.Size(428, 315); + this.FileDetailsGroupBox.TabIndex = 5; + this.FileDetailsGroupBox.TabStop = false; + this.FileDetailsGroupBox.Text = "File Details:"; + // + // DiffResultsGroupBox + // + this.DiffResultsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.DiffResultsGroupBox.Location = new System.Drawing.Point(424, 524); + this.DiffResultsGroupBox.Name = "DiffResultsGroupBox"; + this.DiffResultsGroupBox.Size = new System.Drawing.Size(428, 317); + this.DiffResultsGroupBox.TabIndex = 6; + this.DiffResultsGroupBox.TabStop = false; + this.DiffResultsGroupBox.Text = "Diff Results:"; + // + // ScanSelectedFolderGroupButton + // + this.ScanSelectedFolderGroupButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.ScanSelectedFolderGroupButton.Enabled = false; + this.ScanSelectedFolderGroupButton.Location = new System.Drawing.Point(227, 111); + this.ScanSelectedFolderGroupButton.Name = "ScanSelectedFolderGroupButton"; + this.ScanSelectedFolderGroupButton.Size = new System.Drawing.Size(185, 40); + this.ScanSelectedFolderGroupButton.TabIndex = 0; + this.ScanSelectedFolderGroupButton.Text = "Scan for Changes"; + this.ScanSelectedFolderGroupButton.UseVisualStyleBackColor = true; + // + // CompareAgainstGroupBox + // + this.CompareAgainstGroupBox.Controls.Add(this.CompareButton); + this.CompareAgainstGroupBox.Controls.Add(this.CompareAgainstFolderGroupComboBox); + this.CompareAgainstGroupBox.Controls.Add(this.CompareAgainstProfileComboBox); + this.CompareAgainstGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.CompareAgainstGroupBox.Location = new System.Drawing.Point(858, 43); + this.CompareAgainstGroupBox.Name = "CompareAgainstGroupBox"; + this.CompareAgainstGroupBox.Size = new System.Drawing.Size(417, 154); + this.CompareAgainstGroupBox.TabIndex = 7; + this.CompareAgainstGroupBox.TabStop = false; + this.CompareAgainstGroupBox.Text = "Compare Against:"; + // + // CompareAgainstProfileComboBox + // + this.CompareAgainstProfileComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CompareAgainstProfileComboBox.FormattingEnabled = true; + this.CompareAgainstProfileComboBox.Location = new System.Drawing.Point(6, 34); + this.CompareAgainstProfileComboBox.Name = "CompareAgainstProfileComboBox"; + this.CompareAgainstProfileComboBox.Size = new System.Drawing.Size(200, 28); + this.CompareAgainstProfileComboBox.TabIndex = 0; + // + // CompareAgainstFolderGroupComboBox + // + this.CompareAgainstFolderGroupComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CompareAgainstFolderGroupComboBox.FormattingEnabled = true; + this.CompareAgainstFolderGroupComboBox.Location = new System.Drawing.Point(6, 83); + this.CompareAgainstFolderGroupComboBox.Name = "CompareAgainstFolderGroupComboBox"; + this.CompareAgainstFolderGroupComboBox.Size = new System.Drawing.Size(200, 28); + this.CompareAgainstFolderGroupComboBox.TabIndex = 1; + // + // CompareButton + // + this.CompareButton.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.CompareButton.Enabled = false; + this.CompareButton.Location = new System.Drawing.Point(301, 109); + this.CompareButton.Name = "CompareButton"; + this.CompareButton.Size = new System.Drawing.Size(107, 41); + this.CompareButton.TabIndex = 2; + this.CompareButton.Text = "Compare"; + this.CompareButton.UseVisualStyleBackColor = true; + // + // FileManager + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1278, 844); + this.Controls.Add(this.MainLayoutPanel); + this.Name = "FileManager"; + this.Text = "File Manager"; + this.MainLayoutPanel.ResumeLayout(false); + this.MainLayoutPanel.PerformLayout(); + this.MainMenuStrip.ResumeLayout(false); + this.MainMenuStrip.PerformLayout(); + this.Panel1.ResumeLayout(false); + this.CompareAgainstGroupBox.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel MainLayoutPanel; + private System.Windows.Forms.MenuStrip MainMenuStrip; + private System.Windows.Forms.ToolStripComboBox SelectProfileComboBoxMainMenu; + private System.Windows.Forms.ToolStripMenuItem ManageMainMenuStrip; + private System.Windows.Forms.ToolStripMenuItem ProfilesManageMainMenu; + private System.Windows.Forms.ToolStripMenuItem NamingPatternsManageMainMenu; + private System.Windows.Forms.ToolStripComboBox SelectFolderGroupComboBoxMainMenu; + private System.Windows.Forms.TreeView FolderGroupTreeView; + private System.Windows.Forms.TreeView DiffViewTreeView; + private System.Windows.Forms.Panel Panel1; + private System.Windows.Forms.GroupBox FileDetailsGroupBox; + private System.Windows.Forms.GroupBox DiffResultsGroupBox; + private System.Windows.Forms.Button ScanSelectedFolderGroupButton; + private System.Windows.Forms.GroupBox CompareAgainstGroupBox; + private System.Windows.Forms.ComboBox CompareAgainstProfileComboBox; + private System.Windows.Forms.ComboBox CompareAgainstFolderGroupComboBox; + private System.Windows.Forms.Button CompareButton; + } +} \ No newline at end of file diff --git a/DataOrganizer/FileManager.cs b/DataOrganizer/FileManager.cs new file mode 100644 index 0000000..351c780 --- /dev/null +++ b/DataOrganizer/FileManager.cs @@ -0,0 +1,193 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace DataOrganizer +{ + public partial class FileManager : Form + { + private List Profiles { get; set; } = new List(); + private List FolderGroups { get; set; } = new List(); + private Snapshot ActiveSnapshot { get; set; } + + public FileManager() + { + InitializeComponent(); + + SelectProfileComboBoxMainMenu.SelectedIndexChanged += SelectProfileComboBoxMainMenu_SelectedIndexChanged; + SelectFolderGroupComboBoxMainMenu.SelectedIndexChanged += SelectFolderGroupComboBoxMainMenu_SelectedIndexChanged; + CompareAgainstProfileComboBox.SelectedIndexChanged += CompareAgainstProfileComboBox_SelectedIndexChanged; + CompareAgainstFolderGroupComboBox.SelectedIndexChanged += CompareAgainstFolderGroupComboBox_SelectedIndexChanged; + CompareButton.Click += CompareButton_Click; + + PopulateProfileComboBox(); + } + + private void CompareButton_Click(object sender, EventArgs e) + { + var db = new DB(); + var p = GetProfileToCompare(); + var f = GetFolderGroupToCompare(); + + } + + private void CompareAgainstProfileComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + ClearDiffResults(); + + CompareAgainstFolderGroupComboBox.Items.Clear(); + + var profile = GetProfileToCompare(); + + foreach(var folder in profile.FolderGroups) + CompareAgainstFolderGroupComboBox.Items.Add(folder.Name); + + if(profile.FolderGroups.Count > 0) CompareAgainstFolderGroupComboBox.SelectedIndex = 0; + } + + private void CompareAgainstFolderGroupComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + ClearDiffResults(); + + CompareButton.Enabled = ScanSelectedFolderGroupButton.Enabled; + } + + private void SelectFolderGroupComboBoxMainMenu_SelectedIndexChanged(object sender, EventArgs e) + { + ClearForm(true); + + var db = new DB(); + var folderGroup = GetSelectedFolderGroup(); + + var files = db.GetFilesForProfileByFolderGroup(GetSelectedProfile().Id, folderGroup.Id); + ActiveSnapshot = new Snapshot(files, folderGroup); + + foreach(var orgFolder in ActiveSnapshot.Root.Folders.Values) + { + FolderGroupTreeView.Nodes.Add(BuildTreeNode(orgFolder)); + } + + ScanSelectedFolderGroupButton.Enabled = files.Count > 0; + CompareButton.Enabled = files.Count > 0; + } + + private TreeNode BuildTreeNode(Folder folder) + { + var node = new TreeNode(folder.Name) { Name = folder.FullPath }; + + foreach(var dir in folder.Folders.Values) + { + node.Nodes.Add(BuildTreeNode(dir)); + } + + foreach(var file in folder.Files.Values) + { + node.Nodes.Add(new TreeNode(file.Name) { Name = file.FullPath }); + } + + return node; + } + + private void SelectProfileComboBoxMainMenu_SelectedIndexChanged(object sender, EventArgs e) + { + ClearForm(); + + FolderGroups = GetSelectedProfile().FolderGroups; + + SelectFolderGroupComboBoxMainMenu.Items.Clear(); + CompareAgainstProfileComboBox.Items.Clear(); + + foreach (var folder in FolderGroups) + SelectFolderGroupComboBoxMainMenu.Items.Add(folder.Name); + + if (FolderGroups.Count > 0) SelectFolderGroupComboBoxMainMenu.SelectedIndex = 0; + + if(Profiles.Count > 1) + { + foreach(var profile in Profiles) + if(profile.Name != SelectProfileComboBoxMainMenu.Text) + CompareAgainstProfileComboBox.Items.Add(profile.Name); + + CompareAgainstProfileComboBox.SelectedIndex = 0; + } + } + + private void ClearForm(bool isFolderGroupChange = false) + { + FolderGroupTreeView.Nodes.Clear(); + DiffViewTreeView.Nodes.Clear(); + if (!isFolderGroupChange) + { + CompareAgainstProfileComboBox.Items.Clear(); + CompareAgainstFolderGroupComboBox.Items.Clear(); + } + CompareButton.Enabled = false; + ScanSelectedFolderGroupButton.Enabled = false; + } + + private void ClearDiffResults() + { + DiffViewTreeView.Nodes.Clear(); + } + + private void PopulateProfileComboBox() + { + var db = new DB(); + Profiles = db.GetProfiles(); + SelectProfileComboBoxMainMenu.Items.Clear(); + + foreach(var profile in Profiles) + SelectProfileComboBoxMainMenu.Items.Add(profile.Name); + + if(Profiles.Count > 0) SelectProfileComboBoxMainMenu.SelectedIndex = 0; + } + + private void RefreshForm() + { + ClearForm(); + + PopulateProfileComboBox(); + } + + private DB.Profile GetSelectedProfile() + { + return Profiles[SelectProfileComboBoxMainMenu.SelectedIndex]; + } + + private DB.FolderGroup GetSelectedFolderGroup() + { + return FolderGroups[SelectFolderGroupComboBoxMainMenu.SelectedIndex]; + } + + private DB.Profile GetProfileToCompare() + { + return Profiles.First(x => x.Name == CompareAgainstProfileComboBox.Text); + } + + private DB.FolderGroup GetFolderGroupToCompare() + { + return GetProfileToCompare().FolderGroups.First(x => x.Name == CompareAgainstFolderGroupComboBox.Text); + + } + + private void ProfilesManageMainMenu_Click(object sender, EventArgs e) + { + var form = new ProfileManager(); + form.ShowDialog(); + + RefreshForm(); + } + + private void NamingPatternsManageMainMenu_Click(object sender, EventArgs e) + { + var form = new NamingConventionManager(); + form.ShowDialog(); + } + } +} diff --git a/DataOrganizer/FileManager.resx b/DataOrganizer/FileManager.resx new file mode 100644 index 0000000..e6884dd --- /dev/null +++ b/DataOrganizer/FileManager.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/DataOrganizer/MainForm.Designer.cs b/DataOrganizer/MainForm.Designer.cs index 46d971a..b4d67d9 100644 --- a/DataOrganizer/MainForm.Designer.cs +++ b/DataOrganizer/MainForm.Designer.cs @@ -36,6 +36,7 @@ this.debugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.deleteDBToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.manageNamingPatternsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newFileManagerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.MainMenu.SuspendLayout(); this.SuspendLayout(); // @@ -57,7 +58,8 @@ this.FileMainMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ManageProfilesFileMainMenu, this.FileManagerFileMainMenu, - this.manageNamingPatternsToolStripMenuItem}); + this.manageNamingPatternsToolStripMenuItem, + this.newFileManagerToolStripMenuItem}); this.FileMainMenu.Name = "FileMainMenu"; this.FileMainMenu.Size = new System.Drawing.Size(54, 29); this.FileMainMenu.Text = "&File"; @@ -112,6 +114,13 @@ this.manageNamingPatternsToolStripMenuItem.Text = "Manage &Naming Patterns"; this.manageNamingPatternsToolStripMenuItem.Click += new System.EventHandler(this.manageNamingPatternsToolStripMenuItem_Click); // + // newFileManagerToolStripMenuItem + // + this.newFileManagerToolStripMenuItem.Name = "newFileManagerToolStripMenuItem"; + this.newFileManagerToolStripMenuItem.Size = new System.Drawing.Size(314, 34); + this.newFileManagerToolStripMenuItem.Text = "New File Manager"; + this.newFileManagerToolStripMenuItem.Click += new System.EventHandler(this.newFileManagerToolStripMenuItem_Click); + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); @@ -140,6 +149,7 @@ private System.Windows.Forms.ToolStripMenuItem debugToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem deleteDBToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem manageNamingPatternsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem newFileManagerToolStripMenuItem; } } diff --git a/DataOrganizer/MainForm.cs b/DataOrganizer/MainForm.cs index 3cd25a1..d1607ad 100644 --- a/DataOrganizer/MainForm.cs +++ b/DataOrganizer/MainForm.cs @@ -40,5 +40,11 @@ namespace DataOrganizer var form = new NamingConventionManager(); form.ShowDialog(); } + + private void newFileManagerToolStripMenuItem_Click(object sender, EventArgs e) + { + var form = new FileManager(); + form.ShowDialog(); + } } } diff --git a/DataOrganizer/Snapshot.cs b/DataOrganizer/Snapshot.cs index dd8d7ba..8c8af3d 100644 --- a/DataOrganizer/Snapshot.cs +++ b/DataOrganizer/Snapshot.cs @@ -211,6 +211,51 @@ namespace DataOrganizer } } + public SnapshotComparsion Diff(Snapshot snapshot) + { + return Compare(this, snapshot); + } + + private SnapshotComparsion Compare(Snapshot a, Snapshot b) + { + var newFiles = new List(); + var modifiedFiles = new List(); + var deletedFiles = new List(); + var existingFiles = a.Files.Values.Except(b.Files.Values); + var newOrgFolders = new List(); + + foreach (var file in b.Files) + if (!a.Files.ContainsKey(file.Key)) newFiles.Add(file.Value); + + foreach (var folder in b.OrganizationFolders) + { + if (!a.OrganizationFolders.ContainsKey(folder.Key) && folder.Key != a.Root.FullPath) + { + newOrgFolders.Add(b.Directories[folder.Key]); + } + } + + foreach (var existingFile in existingFiles) + { + if (!b.Files.ContainsKey(existingFile.FullPath)) + { + deletedFiles.Add(existingFile); + } + else if (existingFile.ModifiedDate != b.Files[existingFile.FullPath].ModifiedDate) + { + modifiedFiles.Add(b.Files[existingFile.FullPath]); + } + } + + return new SnapshotComparsion() + { + NewFiles = newFiles, + ModifiedFiles = modifiedFiles, + DeletedFiles = deletedFiles, + NewOrganizationalFolders = newOrgFolders + }; + } + public struct Duplicate { public DB.DBFileSnapshot File; @@ -394,6 +439,9 @@ namespace DataOrganizer public class SnapshotComparsion { - + public List NewFiles { get; set; } + public List ModifiedFiles { get; set; } + public List DeletedFiles { get; set; } + public List NewOrganizationalFolders { get; set; } } }