Show the amount of time it takes to complete a search
Remove Debug Messages Eliminate crash due to SQL connections The location for search result was changed from bullets to meaningful values.
This commit is contained in:
parent
006d194d01
commit
697fbf98f8
@ -290,6 +290,7 @@ namespace VEPROMS
|
|||||||
Database.LastDatabase = Properties.Settings.Default.DefaultDB;
|
Database.LastDatabase = Properties.Settings.Default.DefaultDB;
|
||||||
// Setup the Context menu for DisplaySearch including the symbols
|
// Setup the Context menu for DisplaySearch including the symbols
|
||||||
displaySearch1.SetupContextMenu();
|
displaySearch1.SetupContextMenu();
|
||||||
|
displaySearch1.SearchComplete += displaySearch1_SearchComplete;
|
||||||
if (!FormatInfo.HasLatestChanges())
|
if (!FormatInfo.HasLatestChanges())
|
||||||
throw new Exception("Inconsistent Formats");
|
throw new Exception("Inconsistent Formats");
|
||||||
if (!ItemAuditInfo.IsChangeManagerVersion())
|
if (!ItemAuditInfo.IsChangeManagerVersion())
|
||||||
@ -323,6 +324,10 @@ namespace VEPROMS
|
|||||||
tv.PauseRefresh += tv_PauseRefresh;
|
tv.PauseRefresh += tv_PauseRefresh;
|
||||||
tv.UnPauseRefresh += tv_UnPauseRefresh;
|
tv.UnPauseRefresh += tv_UnPauseRefresh;
|
||||||
}
|
}
|
||||||
|
void displaySearch1_SearchComplete(object sender, DisplaySearchEventArgs args)
|
||||||
|
{
|
||||||
|
ProgBarText = string.Format("{0} Seconds", args.HowLong.TotalSeconds);
|
||||||
|
}
|
||||||
private bool _PauseRefresh = false;
|
private bool _PauseRefresh = false;
|
||||||
public bool PauseRefresh
|
public bool PauseRefresh
|
||||||
{
|
{
|
||||||
|
@ -32,25 +32,34 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region Log4Net
|
#region Log4Net
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#endregion
|
#endregion
|
||||||
|
private static string _DBServer = null;
|
||||||
public static string DBServer
|
public static string DBServer
|
||||||
{ get
|
{
|
||||||
|
get
|
||||||
{
|
{
|
||||||
try
|
if (_DBServer == null)
|
||||||
{
|
{
|
||||||
string server = "";
|
string cnstr = null;
|
||||||
string db = "";
|
try
|
||||||
Match m = Regex.Match(Database.VEPROMS_SqlConnection.ConnectionString, "Data Source=([^;]+)(;[^;]+)*;*Initial Catalog=([^;]+)(;[^;]+)*");
|
|
||||||
if (m.Success && m.Groups.Count > 4)
|
|
||||||
{
|
{
|
||||||
server = m.Groups[1].Value;
|
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||||
db = m.Groups[3].Value;
|
cnstr = cn.ConnectionString;
|
||||||
|
string server = "";
|
||||||
|
string db = "";
|
||||||
|
Match m = Regex.Match(cnstr, "Data Source=([^;]+)(;[^;]+)*;*Initial Catalog=([^;]+)(;[^;]+)*");
|
||||||
|
if (m.Success && m.Groups.Count > 4)
|
||||||
|
{
|
||||||
|
server = m.Groups[1].Value;
|
||||||
|
db = m.Groups[3].Value;
|
||||||
|
}
|
||||||
|
_DBServer = string.Format("{0} - {1}", server, db);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
_DBServer = cnstr;
|
||||||
}
|
}
|
||||||
return string.Format("{0} - {1}", server, db);
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
return Database.VEPROMS_SqlConnection.ConnectionString;
|
|
||||||
}
|
}
|
||||||
|
return _DBServer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private static int _DefaultTimeout = 600; // 600 seconds, i.e. 10 minutes
|
private static int _DefaultTimeout = 600; // 600 seconds, i.e. 10 minutes
|
||||||
|
@ -22,6 +22,12 @@ namespace Volian.Controls.Library
|
|||||||
if (PrintRequest != null)
|
if (PrintRequest != null)
|
||||||
PrintRequest(this, args);
|
PrintRequest(this, args);
|
||||||
}
|
}
|
||||||
|
public event DisplaySearchEvent SearchComplete;
|
||||||
|
private void OnSearchComplete(DisplaySearchEventArgs args)
|
||||||
|
{
|
||||||
|
if (SearchComplete != null)
|
||||||
|
SearchComplete(this, args);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Properties
|
#region Properties
|
||||||
private string _strSrchText = "";
|
private string _strSrchText = "";
|
||||||
@ -1369,7 +1375,8 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
Cursor = savcursor;
|
Cursor = savcursor;
|
||||||
}
|
}
|
||||||
Console.WriteLine("{0} Milliseconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalMilliseconds);
|
//Console.WriteLine("{0} Milliseconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalMilliseconds);
|
||||||
|
OnSearchComplete(new DisplaySearchEventArgs(TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks)));
|
||||||
//if (VlnSettings.DebugMode)
|
//if (VlnSettings.DebugMode)
|
||||||
// MessageBox.Show(string.Format("{0} Milliseconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalMilliseconds));
|
// MessageBox.Show(string.Format("{0} Milliseconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalMilliseconds));
|
||||||
}
|
}
|
||||||
@ -2190,6 +2197,16 @@ namespace Volian.Controls.Library
|
|||||||
get { return _MyItemInfoList; }
|
get { return _MyItemInfoList; }
|
||||||
set { _MyItemInfoList = value; }
|
set { _MyItemInfoList = value; }
|
||||||
}
|
}
|
||||||
|
private TimeSpan _HowLong = TimeSpan.FromTicks(0);
|
||||||
|
public TimeSpan HowLong
|
||||||
|
{
|
||||||
|
get { return _HowLong; }
|
||||||
|
set { _HowLong = value; }
|
||||||
|
}
|
||||||
|
public DisplaySearchEventArgs(TimeSpan howLong)
|
||||||
|
{
|
||||||
|
HowLong = howLong;
|
||||||
|
}
|
||||||
public DisplaySearchEventArgs(string reportTitle, string typesSelected, string searchString, ICollection<ItemInfo> myItemInfoList)
|
public DisplaySearchEventArgs(string reportTitle, string typesSelected, string searchString, ICollection<ItemInfo> myItemInfoList)
|
||||||
{
|
{
|
||||||
_ReportTitle = reportTitle;
|
_ReportTitle = reportTitle;
|
||||||
|
@ -697,7 +697,7 @@ namespace Volian.Controls.Library
|
|||||||
if (_MyEditItem.RTBLastFocus)
|
if (_MyEditItem.RTBLastFocus)
|
||||||
{
|
{
|
||||||
trackerSC++;
|
trackerSC++;
|
||||||
/*if (trackerSC>20) */Console.WriteLine("ShowCaret: {0}", trackerSC);
|
/*if (trackerSC>20) *///Console.WriteLine("ShowCaret: {0}", trackerSC);
|
||||||
//Volian.Base.Library.vlnStackTrace.ShowStack("ShowCaret: EI: {0} StepRTB: {1}", _MyEditItem.MyItemInfo.ItemID, _MyStepRTB.MyItemInfo.ItemID);
|
//Volian.Base.Library.vlnStackTrace.ShowStack("ShowCaret: EI: {0} StepRTB: {1}", _MyEditItem.MyItemInfo.ItemID, _MyStepRTB.MyItemInfo.ItemID);
|
||||||
if (!_MyStepRTB.Visible)
|
if (!_MyStepRTB.Visible)
|
||||||
_MyStepRTB.Visible = true;
|
_MyStepRTB.Visible = true;
|
||||||
@ -727,7 +727,7 @@ namespace Volian.Controls.Library
|
|||||||
if (_MyStepRTB != null && !_MyStepRTB.Disposing && !_MyStepRTB.Closed)
|
if (_MyStepRTB != null && !_MyStepRTB.Disposing && !_MyStepRTB.Closed)
|
||||||
{
|
{
|
||||||
trackerHC++;
|
trackerHC++;
|
||||||
/* if (trackerHC>20)*/ Console.WriteLine("HideCaret {0}", trackerHC);
|
/* if (trackerHC>20)*/ //Console.WriteLine("HideCaret {0}", trackerHC);
|
||||||
//Volian.Base.Library.vlnStackTrace.ShowStack("HideCaret: StepRTB: {0}", _MyStepRTB.MyItemInfo.ItemID);
|
//Volian.Base.Library.vlnStackTrace.ShowStack("HideCaret: StepRTB: {0}", _MyStepRTB.MyItemInfo.ItemID);
|
||||||
HideTheCaret();
|
HideTheCaret();
|
||||||
if (_MyStepRTB.SelectionLength > 0)
|
if (_MyStepRTB.SelectionLength > 0)
|
||||||
|
@ -836,7 +836,10 @@ namespace Volian.Print.Library
|
|||||||
StepInfo stpinfo = StepInfo.Get(pitem.ItemID);
|
StepInfo stpinfo = StepInfo.Get(pitem.ItemID);
|
||||||
string thisTab = stpinfo.MyTab.CleanText; //StepInfo.Get(pitem.ItemID).MyTab.CleanText;
|
string thisTab = stpinfo.MyTab.CleanText; //StepInfo.Get(pitem.ItemID).MyTab.CleanText;
|
||||||
if (IncludesParentToHLS(stpinfo))
|
if (IncludesParentToHLS(stpinfo))
|
||||||
return thisTab;
|
if (!thisTab.Contains("\u25CF")) //Remove Bullet
|
||||||
|
return thisTab;
|
||||||
|
else
|
||||||
|
thisTab = null;
|
||||||
string typeName = stpinfo.FormatStepData.StepEditData.TypeMenu.MenuItem;//stpinfo.FormatStepData.ToString();
|
string typeName = stpinfo.FormatStepData.StepEditData.TypeMenu.MenuItem;//stpinfo.FormatStepData.ToString();
|
||||||
// remove delimiters of '.' and ')' in tab.
|
// remove delimiters of '.' and ')' in tab.
|
||||||
if (thisTab != null)
|
if (thisTab != null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user