Added Ability to Sort Results by SourceSafe date or Development Date
This commit is contained in:
parent
8a1e5caff2
commit
116e10218d
@ -5,7 +5,7 @@ using System.IO;
|
|||||||
|
|
||||||
namespace Sync
|
namespace Sync
|
||||||
{
|
{
|
||||||
class FileCompare
|
public class FileCompare
|
||||||
{
|
{
|
||||||
private FileInfo _Developement;
|
private FileInfo _Developement;
|
||||||
private FileInfo _SourceSafe;
|
private FileInfo _SourceSafe;
|
||||||
|
22
PROMS/Sync/Sync/frmSync.Designer.cs
generated
22
PROMS/Sync/Sync/frmSync.Designer.cs
generated
@ -64,13 +64,13 @@ namespace Sync
|
|||||||
this.checkedOutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.checkedOutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.differentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.differentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.contentDifferentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.contentDifferentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.differentAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.sourceSafeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.sourceSafeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.restoreUnchangedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.restoreUnchangedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.restoreSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.restoreSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.restoreAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.restoreAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.restoreReadOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.restoreReadOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.listToClipboardToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.listToClipboardToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.differentAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
this.panel1.SuspendLayout();
|
this.panel1.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.dgv)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.dgv)).BeginInit();
|
||||||
this.cms.SuspendLayout();
|
this.cms.SuspendLayout();
|
||||||
@ -226,6 +226,7 @@ namespace Sync
|
|||||||
this.dgv.Name = "dgv";
|
this.dgv.Name = "dgv";
|
||||||
this.dgv.Size = new System.Drawing.Size(759, 283);
|
this.dgv.Size = new System.Drawing.Size(759, 283);
|
||||||
this.dgv.TabIndex = 2;
|
this.dgv.TabIndex = 2;
|
||||||
|
this.dgv.ColumnHeaderMouseClick += dgv_ColumnHeaderMouseClick;
|
||||||
this.dgv.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler(this.dgv_ColumnWidthChanged);
|
this.dgv.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler(this.dgv_ColumnWidthChanged);
|
||||||
this.dgv.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dgv_MouseDown);
|
this.dgv.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dgv_MouseDown);
|
||||||
//
|
//
|
||||||
@ -340,14 +341,14 @@ namespace Sync
|
|||||||
// clearToolStripMenuItem
|
// clearToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.clearToolStripMenuItem.Name = "clearToolStripMenuItem";
|
this.clearToolStripMenuItem.Name = "clearToolStripMenuItem";
|
||||||
this.clearToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
this.clearToolStripMenuItem.Size = new System.Drawing.Size(101, 22);
|
||||||
this.clearToolStripMenuItem.Text = "Clear";
|
this.clearToolStripMenuItem.Text = "Clear";
|
||||||
this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click);
|
this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// buildToolStripMenuItem
|
// buildToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.buildToolStripMenuItem.Name = "buildToolStripMenuItem";
|
this.buildToolStripMenuItem.Name = "buildToolStripMenuItem";
|
||||||
this.buildToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
this.buildToolStripMenuItem.Size = new System.Drawing.Size(101, 22);
|
||||||
this.buildToolStripMenuItem.Text = "Build";
|
this.buildToolStripMenuItem.Text = "Build";
|
||||||
this.buildToolStripMenuItem.Click += new System.EventHandler(this.buildToolStripMenuItem_Click);
|
this.buildToolStripMenuItem.Click += new System.EventHandler(this.buildToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
@ -383,6 +384,13 @@ namespace Sync
|
|||||||
this.contentDifferentToolStripMenuItem.Text = "Content Different";
|
this.contentDifferentToolStripMenuItem.Text = "Content Different";
|
||||||
this.contentDifferentToolStripMenuItem.Click += new System.EventHandler(this.contentDifferentToolStripMenuItem_Click);
|
this.contentDifferentToolStripMenuItem.Click += new System.EventHandler(this.contentDifferentToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
|
// differentAllToolStripMenuItem
|
||||||
|
//
|
||||||
|
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);
|
||||||
|
//
|
||||||
// sourceSafeToolStripMenuItem
|
// sourceSafeToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.sourceSafeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.sourceSafeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
@ -429,13 +437,6 @@ namespace Sync
|
|||||||
this.listToClipboardToolStripMenuItem.Text = "List toClipboard";
|
this.listToClipboardToolStripMenuItem.Text = "List toClipboard";
|
||||||
this.listToClipboardToolStripMenuItem.Click += new System.EventHandler(this.listToClipboardToolStripMenuItem_Click);
|
this.listToClipboardToolStripMenuItem.Click += new System.EventHandler(this.listToClipboardToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// differentAllToolStripMenuItem
|
|
||||||
//
|
|
||||||
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
|
// frmSync
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
@ -462,7 +463,6 @@ namespace Sync
|
|||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private System.Windows.Forms.Panel panel1;
|
private System.Windows.Forms.Panel panel1;
|
||||||
|
@ -194,6 +194,7 @@ namespace Sync
|
|||||||
private void frmSync_FormClosing(object sender, FormClosingEventArgs e)
|
private void frmSync_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
{
|
{
|
||||||
Properties.Settings.Default.Location = Location;
|
Properties.Settings.Default.Location = Location;
|
||||||
|
WindowState = FormWindowState.Normal;
|
||||||
Properties.Settings.Default.Size = Size;
|
Properties.Settings.Default.Size = Size;
|
||||||
Properties.Settings.Default.DevelopmentFolder = tbDevelopment.Text;
|
Properties.Settings.Default.DevelopmentFolder = tbDevelopment.Text;
|
||||||
Properties.Settings.Default.SourceSafeFolder = tbSourceSafe.Text;
|
Properties.Settings.Default.SourceSafeFolder = tbSourceSafe.Text;
|
||||||
@ -683,5 +684,42 @@ namespace Sync
|
|||||||
CompareOneFile(fc.FileName, fc.FileName.Replace(tbDevelopment.Text, tbSSMailBox.Text));
|
CompareOneFile(fc.FileName, fc.FileName.Replace(tbDevelopment.Text, tbSSMailBox.Text));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dgv_ColumnHeaderMouseClick(object sender, System.Windows.Forms.DataGridViewCellMouseEventArgs e)
|
||||||
|
{
|
||||||
|
Console.WriteLine("{0},{1}",e.ColumnIndex,e.RowIndex);
|
||||||
|
SortedList<DateTime, FileCompare> sorted = new SortedList<DateTime, FileCompare>();
|
||||||
|
List<FileCompare> fcnew = new List<FileCompare>();
|
||||||
|
//ComparerDevModified myComparer = new ComparerDevModified();
|
||||||
|
switch (e.ColumnIndex)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
dgv.DataSource = _CheckedOut;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
foreach (FileCompare fc in _CheckedOut)
|
||||||
|
sorted.Add(GetUniqueDateTime(sorted,fc.DevModified), fc);
|
||||||
|
foreach (FileCompare fc in sorted.Values)
|
||||||
|
fcnew.Add(fc);
|
||||||
|
dgv.DataSource = fcnew;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
foreach (FileCompare fc in _CheckedOut)
|
||||||
|
sorted.Add(GetUniqueDateTime(sorted,fc.SSModified), fc);
|
||||||
|
foreach (FileCompare fc in sorted.Values)
|
||||||
|
fcnew.Add(fc);
|
||||||
|
dgv.DataSource = fcnew;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
SetColumnWidth();
|
||||||
|
}
|
||||||
|
|
||||||
|
private DateTime GetUniqueDateTime(SortedList<DateTime, FileCompare> sorted, DateTime? dt)
|
||||||
|
{
|
||||||
|
DateTime dtUnique = dt ?? DateTime.Now;
|
||||||
|
while (sorted.Keys.Contains(dtUnique))
|
||||||
|
dtUnique += TimeSpan.FromTicks(1);
|
||||||
|
return dtUnique;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -129,6 +129,9 @@
|
|||||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>194, 17</value>
|
<value>194, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>33</value>
|
||||||
|
</metadata>
|
||||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user