public void init(MailLink link, int position, int width, bool isClickable, MailAttachmentPanel parent)
            {
                this.m_parent = parent;
                this.parentLink = link;
                this.clickable = isClickable;
                this.clearControls();
                if ((position & 1) == 0)
                {
                    this.backgroundImage.Image = (Image) GFXLibrary.char_line_01;
                }
                else
                {
                    this.backgroundImage.Image = (Image) GFXLibrary.char_line_02;
                }
                this.backgroundImage.Position = new Point(0, 5);
                base.addControl(this.backgroundImage);
                this.Size = new Size(width, 30);
                this.nameLabel.Color = ARGBColors.Black;
                this.nameLabel.RolloverColor = ARGBColors.White;
                this.nameLabel.Position = new Point(1, -10);
                this.nameLabel.Size = new Size(base.Width, this.backgroundImage.Height + 20);
                this.nameLabel.Font = FontManager.GetFont("Arial", 8.25f, FontStyle.Regular);
                this.nameLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
                this.nameLabel.Text = this.parentLink.objectName;
                this.backgroundImage.addControl(this.nameLabel);
                switch (this.parentLink.linkType)
                {
                    case 1:
                        this.linkTypeImage.Image = (Image) GFXLibrary.mail2_attach_type_player;
                        this.backgroundImage.CustomTooltipID = 0x203;
                        this.nameLabel.CustomTooltipID = 0x203;
                        this.linkTypeImage.CustomTooltipID = 0x203;
                        break;

                    case 2:
                        this.linkTypeImage.Image = (Image) GFXLibrary.mail2_attach_type_village;
                        this.backgroundImage.CustomTooltipID = 0x204;
                        this.nameLabel.CustomTooltipID = 0x204;
                        this.linkTypeImage.CustomTooltipID = 0x204;
                        break;

                    case 3:
                        this.linkTypeImage.Image = (Image) GFXLibrary.mail2_attach_type_parish;
                        this.backgroundImage.CustomTooltipID = 0x205;
                        this.nameLabel.CustomTooltipID = 0x205;
                        this.linkTypeImage.CustomTooltipID = 0x205;
                        break;
                }
                this.linkTypeImage.setSizeToImage();
                this.linkTypeImage.Position = new Point(base.Width - this.linkTypeImage.Width, 0);
                base.addControl(this.linkTypeImage);
                this.backgroundImage.Width = base.Width - (this.linkTypeImage.Width / 2);
                this.linkTypeImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.lineClicked));
                base.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.lineClicked));
                this.nameLabel.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.lineClicked));
                this.backgroundImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.lineClicked));
            }
 private void InitializeComponent()
 {
     this.components = new Container();
     this.customPanel = new MailAttachmentPanel();
     this.tbPlayerInput = new TextBox();
     this.tbRegionInput = new TextBox();
     base.AutoScaleMode = AutoScaleMode.Font;
     base.SuspendLayout();
     base.Size = new Size(0xd9, 430);
     this.tbPlayerInput.BackColor = Color.FromArgb(0xf7, 0xfc, 0xfe);
     this.tbPlayerInput.ForeColor = ARGBColors.Black;
     this.tbPlayerInput.Location = new Point(0x1b, 0x55);
     this.tbPlayerInput.MaxLength = 50;
     this.tbPlayerInput.Name = "tbPlayerInput";
     this.tbPlayerInput.Size = new Size(160, 20);
     this.tbPlayerInput.TabIndex = 11;
     this.tbPlayerInput.TextChanged += new EventHandler(this.tbFindInput_TextChanged);
     this.tbPlayerInput.KeyUp += new KeyEventHandler(this.tbFindInput_KeyUp);
     this.tbPlayerInput.KeyPress += new KeyPressEventHandler(this.tbFindInput_KeyPress);
     this.tbPlayerInput.Visible = false;
     this.tbRegionInput.BackColor = Color.FromArgb(0xf7, 0xfc, 0xfe);
     this.tbRegionInput.ForeColor = ARGBColors.Black;
     this.tbRegionInput.Location = new Point(0x1b, 0x55);
     this.tbRegionInput.MaxLength = 50;
     this.tbRegionInput.Name = "tbRegionInput";
     this.tbRegionInput.Size = new Size(160, 20);
     this.tbRegionInput.TabIndex = 12;
     this.tbRegionInput.TextChanged += new EventHandler(this.tbFindInput_TextChanged);
     this.tbRegionInput.KeyUp += new KeyEventHandler(this.tbFindInput_KeyUp);
     this.tbRegionInput.KeyPress += new KeyPressEventHandler(this.tbFindInput_KeyPress);
     this.tbRegionInput.Visible = false;
     this.customPanel.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
     this.customPanel.ClickThru = false;
     this.customPanel.Location = new Point(0, 0);
     this.customPanel.Name = "customPanel";
     this.customPanel.PanelActive = true;
     this.customPanel.StoredGraphics = null;
     this.customPanel.TabIndex = 0x63;
     base.AutoScaleMode = AutoScaleMode.None;
     this.BackColor = ARGBColors.Transparent;
     base.BorderStyle = BorderStyle.None;
     base.Name = "ReligiousReportPanel";
     base.Controls.Add(this.tbPlayerInput);
     base.Controls.Add(this.tbRegionInput);
     base.Controls.Add(this.customPanel);
     base.ResumeLayout(false);
 }
 public void init(int position, int width, WorldMap.VillageData data, int villageSize, MailAttachmentPanel parent)
 {
     this.m_parent = parent;
     this.villageID = data.id;
     this.clearControls();
     if ((position & 1) == 0)
     {
         this.backgroundImage.Image = (Image) GFXLibrary.char_line_01;
     }
     else
     {
         this.backgroundImage.Image = (Image) GFXLibrary.char_line_02;
     }
     this.backgroundImage.Position = new Point(0, 5);
     base.addControl(this.backgroundImage);
     this.Size = new Size(width, 30);
     if (GameEngine.Instance.World.isCapital(this.villageID))
     {
         int num = 0;
         if (GameEngine.Instance.World.isRegionCapital(this.villageID))
         {
             num = 0;
         }
         else if (GameEngine.Instance.World.isCountyCapital(this.villageID))
         {
             num = 1;
         }
         else if (GameEngine.Instance.World.isProvinceCapital(this.villageID))
         {
             num = 2;
         }
         else if (GameEngine.Instance.World.isCountryCapital(this.villageID))
         {
             num = 3;
         }
         this.sizeImage.Image = (Image) GFXLibrary.char_position[num + 4];
         this.sizeImage.Position = new Point(5, -4);
         this.backgroundImage.addControl(this.sizeImage);
     }
     else
     {
         int index = GameEngine.Instance.World.getVillageSize(this.villageID);
         this.sizeImage.Image = (Image) GFXLibrary.char_village_icons[index];
         this.sizeImage.Position = new Point(-10, -18);
         this.backgroundImage.addControl(this.sizeImage);
     }
     this.nameLabel.Color = this.isAddedFlag ? ARGBColors.Chartreuse : ARGBColors.Black;
     this.nameLabel.Position = new Point(0x23, -10);
     this.nameLabel.Size = new Size(base.Width, this.backgroundImage.Height + 20);
     this.nameLabel.Font = FontManager.GetFont("Arial", 8.25f, FontStyle.Regular);
     this.nameLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
     this.nameLabel.Text = data.m_villageName;
     this.backgroundImage.addControl(this.nameLabel);
     this.sizeImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.lineClicked));
     base.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.lineClicked));
     this.nameLabel.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.lineClicked));
     this.backgroundImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.lineClicked));
 }