From 46ae4fe723b54f08136ffdf1a90708ae9d1d7360 Mon Sep 17 00:00:00 2001 From: Rich Date: Fri, 10 Apr 2015 10:06:21 +0000 Subject: [PATCH] Added Find Menu Option (DifferentAll) which will include SLN and CSPROJ files. This will be needed to complete the conversion to VS2013. --- PROMS/Sync/Sync/frmSync.Designer.cs | 66 +++++++++++++++++------------ PROMS/Sync/Sync/frmSync.cs | 18 ++++++-- 2 files changed, 53 insertions(+), 31 deletions(-) diff --git a/PROMS/Sync/Sync/frmSync.Designer.cs b/PROMS/Sync/Sync/frmSync.Designer.cs index a744779d..e15c8dfd 100644 --- a/PROMS/Sync/Sync/frmSync.Designer.cs +++ b/PROMS/Sync/Sync/frmSync.Designer.cs @@ -47,6 +47,8 @@ namespace Sync this.dgv = new System.Windows.Forms.DataGridView(); this.cms = new System.Windows.Forms.ContextMenuStrip(this.components); this.compareToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.compareSourceSafeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.compareMailboxToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.restoreToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); @@ -68,8 +70,7 @@ namespace Sync this.restoreAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.restoreReadOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.listToClipboardToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.compareSourceSafeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.compareMailboxToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.differentAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgv)).BeginInit(); this.cms.SuspendLayout(); @@ -109,8 +110,8 @@ namespace Sync // // tbSSMailBox // - this.tbSSMailBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.tbSSMailBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.tbSSMailBox.Location = new System.Drawing.Point(120, 88); this.tbSSMailBox.Name = "tbSSMailBox"; this.tbSSMailBox.Size = new System.Drawing.Size(546, 20); @@ -139,8 +140,8 @@ namespace Sync // // tbMailBox // - this.tbMailBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.tbMailBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.tbMailBox.Location = new System.Drawing.Point(120, 62); this.tbMailBox.Name = "tbMailBox"; this.tbMailBox.Size = new System.Drawing.Size(546, 20); @@ -169,8 +170,8 @@ namespace Sync // // tbSourceSafe // - this.tbSourceSafe.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.tbSourceSafe.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.tbSourceSafe.Location = new System.Drawing.Point(120, 36); this.tbSourceSafe.Name = "tbSourceSafe"; this.tbSourceSafe.Size = new System.Drawing.Size(546, 20); @@ -199,8 +200,8 @@ namespace Sync // // tbDevelopment // - this.tbDevelopment.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.tbDevelopment.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.tbDevelopment.Location = new System.Drawing.Point(120, 10); this.tbDevelopment.Name = "tbDevelopment"; this.tbDevelopment.Size = new System.Drawing.Size(546, 20); @@ -225,8 +226,8 @@ namespace Sync this.dgv.Name = "dgv"; this.dgv.Size = new System.Drawing.Size(759, 283); this.dgv.TabIndex = 2; - this.dgv.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dgv_MouseDown); this.dgv.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler(this.dgv_ColumnWidthChanged); + this.dgv.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dgv_MouseDown); // // cms // @@ -236,7 +237,7 @@ namespace Sync this.compareMailboxToolStripMenuItem, this.restoreToolStripMenuItem}); this.cms.Name = "cms"; - this.cms.Size = new System.Drawing.Size(188, 114); + this.cms.Size = new System.Drawing.Size(188, 92); // // compareToolStripMenuItem // @@ -245,6 +246,20 @@ namespace Sync this.compareToolStripMenuItem.Text = "Compare"; this.compareToolStripMenuItem.Click += new System.EventHandler(this.compareToolStripMenuItem_Click); // + // compareSourceSafeToolStripMenuItem + // + this.compareSourceSafeToolStripMenuItem.Name = "compareSourceSafeToolStripMenuItem"; + this.compareSourceSafeToolStripMenuItem.Size = new System.Drawing.Size(187, 22); + this.compareSourceSafeToolStripMenuItem.Text = "Compare Source Safe"; + this.compareSourceSafeToolStripMenuItem.Click += new System.EventHandler(this.compareSourceSafeToolStripMenuItem_Click); + // + // compareMailboxToolStripMenuItem + // + this.compareMailboxToolStripMenuItem.Name = "compareMailboxToolStripMenuItem"; + this.compareMailboxToolStripMenuItem.Size = new System.Drawing.Size(187, 22); + this.compareMailboxToolStripMenuItem.Text = "Compare Mailbox"; + this.compareMailboxToolStripMenuItem.Click += new System.EventHandler(this.compareMailboxToolStripMenuItem_Click); + // // restoreToolStripMenuItem // this.restoreToolStripMenuItem.Name = "restoreToolStripMenuItem"; @@ -325,14 +340,14 @@ namespace Sync // clearToolStripMenuItem // this.clearToolStripMenuItem.Name = "clearToolStripMenuItem"; - this.clearToolStripMenuItem.Size = new System.Drawing.Size(101, 22); + this.clearToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.clearToolStripMenuItem.Text = "Clear"; this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click); // // buildToolStripMenuItem // this.buildToolStripMenuItem.Name = "buildToolStripMenuItem"; - this.buildToolStripMenuItem.Size = new System.Drawing.Size(101, 22); + this.buildToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.buildToolStripMenuItem.Text = "Build"; this.buildToolStripMenuItem.Click += new System.EventHandler(this.buildToolStripMenuItem_Click); // @@ -341,7 +356,8 @@ namespace Sync this.findToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.checkedOutToolStripMenuItem, this.differentToolStripMenuItem, - this.contentDifferentToolStripMenuItem}); + this.contentDifferentToolStripMenuItem, + this.differentAllToolStripMenuItem}); this.findToolStripMenuItem.Name = "findToolStripMenuItem"; this.findToolStripMenuItem.Size = new System.Drawing.Size(42, 20); this.findToolStripMenuItem.Text = "Find"; @@ -413,19 +429,12 @@ namespace Sync this.listToClipboardToolStripMenuItem.Text = "List toClipboard"; this.listToClipboardToolStripMenuItem.Click += new System.EventHandler(this.listToClipboardToolStripMenuItem_Click); // - // compareSourceSafeToolStripMenuItem + // differentAllToolStripMenuItem // - this.compareSourceSafeToolStripMenuItem.Name = "compareSourceSafeToolStripMenuItem"; - this.compareSourceSafeToolStripMenuItem.Size = new System.Drawing.Size(187, 22); - this.compareSourceSafeToolStripMenuItem.Text = "Compare Source Safe"; - this.compareSourceSafeToolStripMenuItem.Click += new System.EventHandler(this.compareSourceSafeToolStripMenuItem_Click); - // - // compareMailboxToolStripMenuItem - // - this.compareMailboxToolStripMenuItem.Name = "compareMailboxToolStripMenuItem"; - this.compareMailboxToolStripMenuItem.Size = new System.Drawing.Size(187, 22); - this.compareMailboxToolStripMenuItem.Text = "Compare Mailbox"; - this.compareMailboxToolStripMenuItem.Click += new System.EventHandler(this.compareMailboxToolStripMenuItem_Click); + this.differentAllToolStripMenuItem.Name = "differentAllToolStripMenuItem"; + this.differentAllToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.differentAllToolStripMenuItem.Text = "DifferentAll"; + this.differentAllToolStripMenuItem.Click += new System.EventHandler(this.differentAllToolStripMenuItem_Click); // // frmSync // @@ -440,8 +449,8 @@ namespace Sync this.MainMenuStrip = this.menuStrip1; this.Name = "frmSync"; this.Text = "Volian Sync"; - this.Load += new System.EventHandler(this.frmSync_Load); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmSync_FormClosing); + this.Load += new System.EventHandler(this.frmSync_Load); this.LocationChanged += new System.EventHandler(this.frmSync_LocationChanged); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); @@ -496,6 +505,7 @@ namespace Sync private System.Windows.Forms.ToolStripMenuItem selectNoneToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem compareSourceSafeToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem compareMailboxToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem differentAllToolStripMenuItem; } } diff --git a/PROMS/Sync/Sync/frmSync.cs b/PROMS/Sync/Sync/frmSync.cs index 57d2c80a..02561d28 100644 --- a/PROMS/Sync/Sync/frmSync.cs +++ b/PROMS/Sync/Sync/frmSync.cs @@ -340,6 +340,18 @@ namespace Sync fc.MoveToDevelopment(); } } + private bool _ExcludeSolutions = true; + private void differentAllToolStripMenuItem_Click(object sender, EventArgs e) + { + _ExcludeSolutions = false; + dgv.EndEdit(); + ClearResults(); + // Walk though Source Safe and check to see if the files in the Development folder are read-only + FindDifferent(new DirectoryInfo(tbSourceSafe.Text)); + dgv.DataSource = _CheckedOut; + SetColumnWidth(); + _ExcludeSolutions = true; + } private void differentToolStripMenuItem_Click(object sender, EventArgs e) { dgv.EndEdit(); @@ -393,8 +405,8 @@ namespace Sync private void FindDifferent(FileInfo fi) { if (fi.Name.ToLower().EndsWith("scc")) return; - if (fi.Name.ToLower().EndsWith("sln")) return; - if (fi.Name.ToLower().EndsWith("csproj")) + if (_ExcludeSolutions && fi.Name.ToLower().EndsWith("sln")) return; + if (_ExcludeSolutions && fi.Name.ToLower().EndsWith("csproj")) { // Find files that have been added to the new Project List compileList = GetCompileList(fi.FullName); @@ -404,7 +416,7 @@ namespace Sync List compileList1 = GetCompileList(fi1csproj.FullName); CompareLists(compileList, compileList1, fi, fi1csproj); } - return; + if(_ExcludeSolutions ) return; } if (fi.Name.ToLower().EndsWith("licx")) return; FileInfo fiD = new FileInfo(fi.FullName.Replace(tbSourceSafe.Text, tbDevelopment.Text));