Exemple #1
0
 public void RenameItemContentEditor(string itemName)
 {
     ContentEditor.SendKeys(Keys.F2);
     ModalText.SendKeys(itemName);
     Driver.SwitchTo().DefaultContent();
     ModalButton.Click();
 }
        protected void DrawModal(object sender, GraphicsEventArgs e)
        {
            if (Display)
            {
                StringFormat stringFormat = new StringFormat();
                stringFormat.Alignment     = StringAlignment.Center;
                stringFormat.LineAlignment = StringAlignment.Center;

                //40, 80, 130

                //193, 234, 255
                e.Graphics.DrawRectangle(drawBorder, Color.FromArgb(90, 40, 80, 130));
                e.Graphics.DrawRectangle(drawRect, Color.FromArgb(100, 40, 80, 130));

                Font mFont = new Font(FontName, FontSize, GraphicsUnit.Point);

                e.Graphics.DrawText(HeaderText, FontName, 18.0f, new PointF(drawBorder.X + headerX, drawBorder.Y + 20), Color.White, drawBorder);

                int YIncreaser = 60;

                if (ModalText != "")
                {
                    List <string> textLines = ModalText.WrapText(700, FontName, FontSize);

                    foreach (string mText in textLines)
                    {
                        e.Graphics.DrawText(mText, FontName, FontSize, new PointF(drawBorder.X + 10, drawBorder.Y + YIncreaser), Color.White, drawBorder);
                        YIncreaser += 30;
                    }

                    YIncreaser += 30;
                }

                //int YIncreaser = 60;

                int i = 0;
                foreach (string x in Responses)
                {
                    e.Graphics.DrawText("[" + (i + 1).ToString() + "] - " + x, FontName, FontSize, new PointF(drawRect.X + 10, drawRect.Y + YIncreaser), Color.White, drawRect);
                    YIncreaser += 20;
                    i++;
                }

                if (ShowClosePrompt == true)
                {
                    YIncreaser += 20;
                    e.Graphics.DrawText("[0] - Close", FontName, FontSize, new PointF(drawRect.X + 10, drawRect.Y + YIncreaser), Color.White, drawRect);
                }
            }
            else
            {
                Game.RawFrameRender -= DrawModal;
            }
        }