FSO.Client.UI.Panels.UIMessage.UIMessage C# (CSharp) Method

UIMessage() public method

Creates a new UIMessage instance.
public UIMessage ( UIMessageType type, MessageAuthor author ) : System
type UIMessageType The type of message (IM, compose or read).
author MessageAuthor Author if type is read or IM, recipient if type is compose.
return System
        public UIMessage(UIMessageType type, MessageAuthor author)
        {
            var script = this.RenderScript("message.uis");

            Messages = new List<IMEntry>();

            BtnBackground = new UIImage(backgroundBtnImage);
            BtnBackground.X = 313;
            BtnBackground.Y = 216;
            this.AddAt(0, BtnBackground);

            TypeBackground = new UIImage(backgroundMessageImage);
            TypeBackground.X = 10;
            TypeBackground.Y = 12;
            this.AddAt(0, TypeBackground);

            Background = new UIImage(backgroundImage);
            this.AddAt(0, Background);

            UIUtils.MakeDraggable(Background, this);
            UIUtils.MakeDraggable(TypeBackground, this);

            LetterSubjectTextEdit.MaxLines = 1;
            LetterSubjectTextEdit.TextMargin = new Microsoft.Xna.Framework.Rectangle(2, 2, 2, 2);

            MessageSlider.AttachButtons(MessageScrollUpButton, MessageScrollDownButton, 1);
            MessageTextEdit.AttachSlider(MessageSlider);
            MessageTextEdit.OnChange += new ChangeDelegate(MessageTextEdit_OnChange);
            SendMessageButton.OnButtonClick += new ButtonClickDelegate(SendMessage);
            MessageTextEdit.OnEnterPress += new KeyPressDelegate(SendMessageEnter);
            SendMessageButton.Disabled = true;

            LetterSlider.AttachButtons(LetterScrollUpButton, LetterScrollDownButton, 1);
            LetterTextEdit.AttachSlider(LetterSlider);
            RespondLetterButton.OnButtonClick += new ButtonClickDelegate(RespondLetterButton_OnButtonClick);
            SendLetterButton.OnButtonClick += new ButtonClickDelegate(SendLetter);

            HistorySlider.AttachButtons(HistoryScrollUpButton, HistoryScrollDownButton, 1);
            HistoryTextEdit.AttachSlider(HistorySlider);

            HistoryTextEdit.TextStyle = HistoryTextEdit.TextStyle.Clone();
            HistoryTextEdit.TextStyle.Size = 8;
            HistoryTextEdit.TextMargin = new Microsoft.Xna.Framework.Rectangle(3, 3, 3, 3);
            HistoryTextEdit.SetSize(333, 100);

            CloseButton.OnButtonClick += new ButtonClickDelegate(CloseButton_OnButtonClick);

            SetType(type);
            SetMessageAuthor(author);
        }