internal static string SprCompileFn(string strText, PwListItem li)
{
string strCmp = null;
while(strCmp == null)
{
try
{
strCmp = SprEngine.Compile(strText, MainForm.GetEntryListSprContext(
li.Entry, Program.MainForm.DocumentManager.SafeFindContainerOf(
li.Entry)));
}
catch(InvalidOperationException) { } // Probably collection changed
catch(NullReferenceException) { } // Objects disposed already
catch(Exception) { Debug.Assert(false); }
}
if(strCmp == strText) return strText;
return (strCmp + " - " + strText);
}