Added MyItemInfo property
Fixed format of ToString for AnnotationAuditInfo Fixed format of ToString for ContentAuditInfo Fixed Restore if no next item Fixed ActiveParent logic after restore Added Timing logic and then Commented it Fixed Logic when there is not a NextNode Timing Debug code Update UserID when saving annotation Commented Timing Debug Created and used FixPath - StepPath Use MyItemInfo.SearchPath if Content doesn't have path Refresh Change List from Timer.Tick Added Timer for Refresh Added code to refresh ChangeBar Added and Commented timing debug Changed logic for saving ROUsages Added Closed Property that is set when the handle is destroyed Don't refresh StepRTB if it is closed
This commit is contained in:
@@ -120,8 +120,8 @@ namespace Volian.Controls.Library
|
||||
private void UpdateHistory()
|
||||
{
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime start = DateTime.Now;
|
||||
Console.WriteLine(start);
|
||||
//DateTime start = DateTime.Now;
|
||||
//Console.WriteLine(start);
|
||||
#region setup
|
||||
btnRestore.Enabled = false;
|
||||
myRTB.Clear();
|
||||
@@ -380,15 +380,15 @@ namespace Volian.Controls.Library
|
||||
tnn.Tag = iai;
|
||||
#endregion
|
||||
}
|
||||
Console.WriteLine("UpdateHistory: {0} seconds",TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds);
|
||||
//Console.WriteLine("UpdateHistory: {0} seconds",TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds);
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
private void WalkProcedure()
|
||||
{
|
||||
//return;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime start = DateTime.Now;
|
||||
Console.WriteLine(start);
|
||||
//DateTime start = DateTime.Now;
|
||||
//Console.WriteLine(start);
|
||||
lbChanges.Items.Clear();
|
||||
if (MyProcedureInfo == null)
|
||||
{
|
||||
@@ -397,17 +397,16 @@ namespace Volian.Controls.Library
|
||||
return;
|
||||
}
|
||||
ContentAuditInfoList cail2 = ContentAuditInfoList.GetChronology(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, false);
|
||||
Console.WriteLine("WalkProcedure cail2: {0} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds);
|
||||
//Console.WriteLine("WalkProcedure cail2: {0} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds);
|
||||
_ChronologyAuditList = cail2;
|
||||
ContentAuditInfoList cail3 = ContentAuditInfoList.GetSummary(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, false);
|
||||
_SummaryAuditList = cail3;
|
||||
AnnotationAuditInfoList aail2 = AnnotationAuditInfoList.GetChronology(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID);
|
||||
Console.WriteLine("WalkProcedure aail2: {0} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds);
|
||||
//Console.WriteLine("WalkProcedure aail2: {0} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds);
|
||||
_AnnotationList = aail2;
|
||||
foreach (ContentAuditInfo cai in cail2)
|
||||
{
|
||||
string itemTitle = Regex.Replace(cai.Path, "^..+?\\u0007", "");
|
||||
itemTitle = itemTitle.Replace("\x11", itemTitle[0]=='\x11' ? "" : " - ");
|
||||
string itemTitle = FixPath(cai.Path);
|
||||
lbChanges.Items.Add(string.Format("{4} item {0} by {1} on {2} @ {3}", cai.ActionWhat, cai.UserID, cai.ActionWhen == DateTime.MinValue ? cai.DTS.ToShortDateString() : cai.ActionWhen.ToShortDateString(), cai.ActionWhen == DateTime.MinValue ? cai.DTS.ToShortTimeString() : cai.ActionWhen.ToShortTimeString(), itemTitle));
|
||||
}
|
||||
foreach (AnnotationAuditInfo aai in aail2)
|
||||
@@ -417,13 +416,19 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
if (cai.ContentID == aai.IContentID)
|
||||
{
|
||||
stepnum = Regex.Replace(cai.Path, "^..+?\\u0007.", "");
|
||||
stepnum = FixPath(cai.Path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
lbChanges.Items.Add(string.Format("{4} Annotation {0} by {1} on {2} @ {3}", aai.ActionWhat, aai.UserID, aai.ActionWhen.ToShortDateString(), aai.ActionWhen.ToShortTimeString(), stepnum));
|
||||
if (stepnum == string.Empty)
|
||||
{
|
||||
ItemInfo iii = aai.MyItemInfo;
|
||||
if(iii != null)
|
||||
stepnum = FixPath(iii.SearchPath);
|
||||
}
|
||||
lbChanges.Items.Add(string.Format("{0} Annotation {1}", stepnum, aai.ToString()));
|
||||
}
|
||||
Console.WriteLine("WalkProcedure fini: {0} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds);
|
||||
//Console.WriteLine("WalkProcedure fini: {0} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds);
|
||||
this.Cursor = Cursors.Default;
|
||||
btnViewSummaryReport.Enabled = btnViewChronologyReport.Enabled = lbChanges.Items.Count > 0;
|
||||
return;
|
||||
@@ -559,6 +564,12 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
btnViewSummaryReport.Enabled = btnViewChronologyReport.Enabled = lbChanges.Items.Count > 0;
|
||||
}
|
||||
private static string FixPath(string path)
|
||||
{
|
||||
string itemTitle = Regex.Replace(path, "^..+?\\u0007", "");
|
||||
itemTitle = itemTitle.Replace("\x11", itemTitle[0] == '\x11' ? "" : " - ").Replace("\\u8209?", "-");
|
||||
return itemTitle;
|
||||
}
|
||||
private void btnViewChronologyReport_Click(object sender, EventArgs e)
|
||||
{
|
||||
//if (lbChanges.Items.Count > 0)
|
||||
@@ -596,7 +607,7 @@ namespace Volian.Controls.Library
|
||||
ItemAuditInfo iai = tn.Tag as ItemAuditInfo;
|
||||
if (MessageBox.Show(this, string.Format("Do you want to restore this {0}?",iai.ItemType), string.Format("Confirm {0} Restore",iai.ItemType), MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
Console.WriteLine("DisplayHistory.btnRestore_Click @ {0}", DateTime.Now);
|
||||
//Console.WriteLine("DisplayHistory.btnRestore_Click @ {0}", DateTime.Now);
|
||||
ItemInfo ii = null;
|
||||
if (iai.Level == 2)
|
||||
{
|
||||
@@ -829,6 +840,17 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
if(this.Visible)this.RefreshList();
|
||||
}
|
||||
public void RefreshChangeList()
|
||||
{
|
||||
myTimer.Enabled = false;
|
||||
myTimer.Enabled = true;
|
||||
}
|
||||
private void myTimer_Tick(object sender, System.EventArgs e)
|
||||
{
|
||||
myTimer.Enabled = false;
|
||||
RefreshList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public delegate void ItemRestoredHandler(ItemInfo restoredItemInfo);
|
||||
|
Reference in New Issue
Block a user