...rm = new System.Resources.ResourceManager("", System.Reflection.Assembly.GetExecutingAssembly());
string rectangleString = tab.FindImage(rm.GetString(""), new[] { new Rectangle(0, 0, mainDocument.Width, mainDocument.Height) }, 99);
if (!String.IsNullOrWhiteSpace(rectangleString))
{...