示例#1
0
        private void MovePlayerFromOnePaneToOther(PlayerListControl source, PlayerListControl destination)
        {
            if (!source.SelectedPlayers.Any())
            {
                MessageBox.Show("Please select player!", "Warning");
                return;
            }

            var players = source.SelectedPlayers.ToList();

            players.ForEach(player =>
            {
                //first remove to unsubscribe from all events
                source.RemovePlayer(player);
                destination.AddPlayer(player);
            });
        }
示例#2
0
        private void InitializeComponent()
        {
            playerListMapSplitContainer = new SplitContainer();
            playerBoxSearchBarContainer = new Panel();
            playerBox          = new PlayerListControl();
            searchBarContainer = new TableLayoutPanel();
            playerSearchBox    = new ZklTextBox();
            sendBox            = new SendBox();
            topicPanel         = new Panel();
            hideButton         = new BitmapButton();
            topicBox           = new ChatBox();
            ChatBox            = new ChatBox();
            splitContainer1    = new ZkSplitContainer();
            ((ISupportInitialize)playerListMapSplitContainer).BeginInit();
            playerListMapSplitContainer.Panel1.SuspendLayout();
            playerListMapSplitContainer.SuspendLayout();
            playerBoxSearchBarContainer.SuspendLayout();
            searchBarContainer.SuspendLayout();
            topicPanel.SuspendLayout();
            ((ISupportInitialize)splitContainer1).BeginInit();
            splitContainer1.Panel1.SuspendLayout();
            splitContainer1.Panel2.SuspendLayout();
            splitContainer1.SuspendLayout();
            SuspendLayout();
            //
            // playerListMapSplitContainer
            //
            playerListMapSplitContainer.BackColor   = Color.DimGray;
            playerListMapSplitContainer.Dock        = DockStyle.Fill;
            playerListMapSplitContainer.Location    = new Point(0, 0);
            playerListMapSplitContainer.Margin      = new Padding(2);
            playerListMapSplitContainer.Name        = "playerListMapSplitContainer";
            playerListMapSplitContainer.Orientation = Orientation.Horizontal;
            //
            // playerListMapSplitContainer.Panel1
            //
            playerListMapSplitContainer.Panel1.Controls.Add(playerBoxSearchBarContainer);
            //
            // playerListMapSplitContainer.Panel2
            //
            playerListMapSplitContainer.Panel2.AutoScroll = true;
            playerListMapSplitContainer.Size             = new Size(326, 793);
            playerListMapSplitContainer.SplitterDistance = 565;
            playerListMapSplitContainer.SplitterWidth    = 3;
            playerListMapSplitContainer.TabIndex         = 0;
            playerListMapSplitContainer.SplitterMoved   += new SplitterEventHandler(playerListMapSplitContainer_SplitterMoved);
            //
            // playerBoxSearchBarContainer
            //
            playerBoxSearchBarContainer.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            playerBoxSearchBarContainer.Controls.Add(playerBox);
            playerBoxSearchBarContainer.Controls.Add(searchBarContainer);
            playerBoxSearchBarContainer.Dock     = DockStyle.Fill;
            playerBoxSearchBarContainer.Location = new Point(0, 0);
            playerBoxSearchBarContainer.Name     = "playerBoxSearchBarContainer";
            playerBoxSearchBarContainer.Size     = new Size(326, 565);
            playerBoxSearchBarContainer.TabIndex = 2;
            //
            // playerBox
            //
            playerBox.BackColor    = Color.DimGray;
            playerBox.Dock         = DockStyle.Fill;
            playerBox.ForeColor    = Color.White;
            playerBox.HoverItem    = null;
            playerBox.IsBattle     = false;
            playerBox.IsSorted     = false;
            playerBox.Location     = new Point(0, 24);
            playerBox.Name         = "playerBox";
            playerBox.SelectedItem = null;
            playerBox.Size         = new Size(326, 541);
            playerBox.TabIndex     = 1;
            //
            // searchBarContainer
            //
            searchBarContainer.ColumnCount = 2;
            searchBarContainer.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize, 20F));
            searchBarContainer.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 20F));
            searchBarContainer.Controls.Add(playerSearchBox, 1, 0);
            searchBarContainer.Dock     = DockStyle.Top;
            searchBarContainer.Location = new Point(0, 0);
            searchBarContainer.Name     = "searchBarContainer";
            searchBarContainer.RowCount = 1;
            searchBarContainer.RowStyles.Add(new RowStyle(SizeType.Absolute, 25F));
            searchBarContainer.Size     = new Size(326, 30);
            searchBarContainer.AutoSize = false;
            searchBarContainer.TabIndex = 0;
            //
            // playerSearchBox
            //
            playerSearchBox.Anchor       = AnchorStyles.Left | AnchorStyles.Top;
            playerSearchBox.Location     = new Point(23, 22);
            playerSearchBox.Name         = "playerSearchBox";
            playerSearchBox.Size         = new Size(300, 20);
            playerSearchBox.Margin       = new Padding(0);
            playerSearchBox.TabIndex     = 0;
            playerSearchBox.Font         = Config.GeneralFontSmall;
            playerSearchBox.TextChanged += new EventHandler(playerSearchBox_TextChanged);
            //
            // sendBox
            //
            sendBox.Dock      = DockStyle.Bottom;
            sendBox.Font      = Config.GeneralFont;
            sendBox.ForeColor = Color.White;
            sendBox.Location  = new Point(0, 765);
            sendBox.Multiline = true;
            sendBox.Name      = "sendBox";
            sendBox.Size      = new Size(800, 28);
            sendBox.TabIndex  = 0;
            sendBox.WordWrap  = false;
            //
            // topicPanel
            //
            topicPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            topicPanel.Controls.Add(hideButton);
            topicPanel.Controls.Add(topicBox);
            topicPanel.Dock     = DockStyle.Top;
            topicPanel.Location = new Point(0, 0);
            topicPanel.Margin   = new Padding(0);
            topicPanel.Name     = "topicPanel";
            topicPanel.Size     = new Size(800, 0);
            topicPanel.TabIndex = 3;
            //
            // hideButton
            //
            hideButton.Anchor                  = (AnchorStyles)(AnchorStyles.Bottom | AnchorStyles.Right);
            hideButton.BackColor               = Color.Transparent;
            hideButton.ButtonStyle             = FrameBorderRenderer.StyleType.DarkHive;
            hideButton.Cursor                  = Cursors.Hand;
            hideButton.FlatStyle               = FlatStyle.Flat;
            hideButton.ForeColor               = Color.White;
            hideButton.Location                = new Point(711, -29);
            hideButton.Name                    = "hideButton";
            hideButton.Size                    = new Size(75, 23);
            hideButton.SoundType               = SoundPalette.SoundType.Click;
            hideButton.TabIndex                = 3;
            hideButton.Text                    = "Hide";
            hideButton.UseVisualStyleBackColor = true;
            hideButton.Click                  += new EventHandler(hideButton_Click);
            //
            // topicBox
            //
            topicBox.BackColor           = Color.FromArgb((int)(byte)0, (int)(byte)30, (int)(byte)40);
            topicBox.ChatBackgroundColor = 0;
            topicBox.DefaultTooltip      = null;
            topicBox.Dock           = DockStyle.Fill;
            topicBox.Font           = Config.GeneralFontBig;
            topicBox.HideScroll     = false;
            topicBox.IRCForeColor   = 0;
            topicBox.LineHighlight  = null;
            topicBox.Location       = new Point(0, 0);
            topicBox.Name           = "topicBox";
            topicBox.NoColorMode    = false;
            topicBox.ShowHistory    = true;
            topicBox.ShowJoinLeave  = false;
            topicBox.ShowUnreadLine = true;
            topicBox.SingleLine     = false;
            topicBox.Size           = new Size(800, 0);
            topicBox.TabIndex       = 2;
            topicBox.TextFilter     = null;
            //
            // ChatBox
            //
            ChatBox.BackColor           = Color.DimGray;
            ChatBox.ChatBackgroundColor = 0;
            ChatBox.DefaultTooltip      = null;
            ChatBox.Dock           = DockStyle.Fill;
            ChatBox.Font           = Config.GeneralFont;
            ChatBox.ForeColor      = Color.White;
            ChatBox.HideScroll     = false;
            ChatBox.IRCForeColor   = 0;
            ChatBox.LineHighlight  = null;
            ChatBox.Location       = new Point(0, 0);
            ChatBox.Name           = "ChatBox";
            ChatBox.NoColorMode    = false;
            ChatBox.ShowHistory    = true;
            ChatBox.ShowJoinLeave  = false;
            ChatBox.ShowUnreadLine = true;
            ChatBox.SingleLine     = false;
            ChatBox.Size           = new Size(800, 765);
            ChatBox.TabIndex       = 1;
            ChatBox.TextFilter     = null;
            //
            // splitContainer1
            //
            splitContainer1.BackColor = Color.Transparent;
            splitContainer1.Dock      = DockStyle.Fill;
            splitContainer1.Location  = new Point(0, 0);
            splitContainer1.Margin    = new Padding(0);
            splitContainer1.Name      = "splitContainer1";
            //
            // splitContainer1.Panel1
            //
            splitContainer1.Panel1.Controls.Add(ChatBox);
            splitContainer1.Panel1.Controls.Add(topicPanel);
            splitContainer1.Panel1.Controls.Add(sendBox);
            //
            // splitContainer1.Panel2
            //
            splitContainer1.Panel2.Controls.Add(playerListMapSplitContainer);
            splitContainer1.Size             = new Size(1130, 793);
            splitContainer1.SplitterDistance = 800;
            splitContainer1.TabIndex         = 0;
            splitContainer1.SplitterMoved   += splitContainer1_SplitterMoved;


            playerBox.BackColor = Config.BgColor;
            playerBox.ForeColor = Config.TextColor;
            playerBox_zklclick.AttachTo(playerBox);
            playerBox_zklclick.MouseClick += PlayerBox_MouseClick;

            playerSearchBox.BackColor = Config.BgColor;
            playerSearchBox.ForeColor = Config.TextColor;


            var searchLabel = new Label()
            {
                Text = "Search: ", AutoSize = true, Font = Config.GeneralFontSmall, Margin = new Padding(3)
            };

            searchBarContainer.Controls.Add(searchLabel, 0, 0);


            //
            // ChatControl
            //
            Controls.Add(splitContainer1);
            Margin = new Padding(0);
            Name   = "ChatControl";
            Size   = new Size(1130, 793);
            playerListMapSplitContainer.Panel1.ResumeLayout(false);
            ((ISupportInitialize)playerListMapSplitContainer).EndInit();
            playerListMapSplitContainer.ResumeLayout(false);
            playerBoxSearchBarContainer.ResumeLayout(false);
            searchBarContainer.ResumeLayout(false);
            topicPanel.ResumeLayout(false);
            splitContainer1.Panel1.ResumeLayout(false);
            splitContainer1.Panel1.PerformLayout();
            splitContainer1.Panel2.ResumeLayout(false);
            ((ISupportInitialize)splitContainer1).EndInit();
            splitContainer1.ResumeLayout(false);
            ResumeLayout(false);
        }