Tab tab = instance.ActiveTab;
if (tab.IsBusy) tab.WaitDownloading();
Document mainDocument = tab.MainDocument;
if (mainDocument.IsVoid) return -1;
ResourceManager 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))
{
string[]split = rectangleString.Split(',');
Rectangle rectangle = new System.Drawing.Rectangle(System.Convert.ToInt32(split[0].Trim()), System.Convert.ToInt32(split[1].Trim()), System.Convert.ToInt32(split[2].Trim()), System.Convert.ToInt32(split[3].Trim()));
if (!rectangle.IsEmpty)
{
rectangle = new System.Drawing.Rectangle(rectangle.X + 147, rectangle.Y + -155, 6, 6);
// Вызвать событие "click" для Left
tab.RiseEvent("click", rectangle, "Left");
System.Threading.Thread.Sleep(500);
if (tab.IsBusy) tab.WaitDownloading();
}
else return -1;
}
else return -1;