I have an object array that i'm returning to use the objects in a different method, however for some reason it's saying "not all code paths return a value"
Here's the code....
private object[] runTests(string banText, object tabControlName, int runThisTest, string testName)
{
if (stopTests == false)
{
var tabPageBrowser = new TabPage();
var Browser = new WebBrowser();
(tabControlName as TabControl).TabPages.Add(tabPageBrowser);
tabPageBrowser.Name = tabControlName.ToString();
tabPageBrowser.Text = testName;
tabPageBrowser.Font = new System.Drawing.Font("Trebuchet MS", 8.25F,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
Browser.Dock = DockStyle.Fill;
Browser.Url = new Uri(testStrings(runThisTest, banText));
Browser.Name = tabControlName.ToString();
Browser.ScriptErrorsSuppressed = true;
tabPageBrowser.Controls.Add(Browser);
try
{
while (Browser.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
}
catch
{
return null;
}
IntPtr pHandle = GetCurrentProcess();
SetProcessWorkingSetSize(pHandle, -1, -1);
object[] browserObjects = new object[2];
browserObjects[0] = tabPageBrowser;
browserObjects[1] = Browser;
if (browserObjects != null)
{
return browserObjects;
}
}
}
I dont see what i'm doing wrong, can you please assist? Thank you!