// установка рандомных размеров окна и инстанса
Random rnd = new Random();
string[] monitorSizeArr = {"1280|720", "1024|768","800|480"};
string monitorSize = monitorSizeArr[rnd.Next(0,2)];
string[] split = monitorSize.Split(new[] {"|"}, StringSplitOptions.None);
int ScrSizeWidth = Convert.ToInt16(split[0]);
int ScrSizeHeight = Convert.ToInt16(split[1]);
int AvailScrWidth = ScrSizeWidth;
int AvailScrHeight = ScrSizeHeight - 30;
int WindowSizeWidth = ScrSizeWidth;
int WindowSizeHeight = ScrSizeHeight;
int OuterWidthShift = rnd.Next(7, 25);
int OuterHeightShift = rnd.Next(96, 140);
project.Profile.ScreenSizeWidth = ScrSizeWidth;
project.Profile.ScreenSizeHeight = ScrSizeHeight;
project.Profile.AvailScreenWidth = AvailScrWidth;
project.Profile.AvailScreenHeight = AvailScrHeight;
project.Profile.OuterWidthShift = OuterWidthShift;
project.Profile.OuterHeightShift = OuterHeightShift;
instance.SetWindowSize(WindowSizeWidth, WindowSizeHeight);