コード例 #1
0
 public FriendsMenu(Server.LogIn serverin, FlowLayoutPanel list, UserInfo u, FlowLayoutPanel text, Better_Better_Forms.MainForm mf)
 {
     InitializeComponent();
     User     = serverin.CurrentUser;
     l        = list;
     ui       = u;
     textArea = text;
     server   = serverin;
     mainForm = mf;
     server.FriendRequestResult += Server_FriendRequestResult;
 }
コード例 #2
0
ファイル: Message.cs プロジェクト: jacobguin/Scorpion
        public Message(SocketMessage msg, FlowLayoutPanel panel, Server.LogIn server, Better_Better_Forms.MainForm text)
        {
            InitializeComponent();
            t = text;
            panel.SizeChanged += Panel_SizeChanged;
            @this              = msg;
            ser           = server;
            Width         = panel.Size.Width - 25;
            Username.Text = msg.Author.UserName;
            Text.Text     = msg.Content;
            Size sz = new Size(Width - 40, int.MaxValue);

            sz                = TextRenderer.MeasureText(Text.Text, Text.Font, sz, TextFormatFlags.WordBreak);
            Text.Height       = sz.Height;
            pictureBox1.Image = Imagery.CropToCircle(msg.Author.Avatar, Theme.MainForm.Controles.Text.Background);
            Height            = 32 + (Text.Height - 5);
            if (server.CurrentUser.ID == msg.Author.ID)
            {
                addFriendToolStripMenuItem.Enabled = false;
            }
            else if (msg.Author.ID == 0)
            {
                addFriendToolStripMenuItem.Enabled = false;
            }
            else if (msg.Author.FriendStatus == FriendStatus.Friends)
            {
                addFriendToolStripMenuItem.Enabled = false;
            }
            else if (msg.Author.FriendStatus == FriendStatus.PendingIN)
            {
                addFriendToolStripMenuItem.Enabled = false;
            }
            else if (msg.Author.FriendStatus == FriendStatus.PendingOut)
            {
                addFriendToolStripMenuItem.Enabled = false;
            }
            SetTheme();
            Theme.FileWatcher.Changed += FileWatcher_Changed;
        }