Ejemplo n.º 1
0
        /// <summary>
        /// Updates the <see cref="Control"/>. This is called for every <see cref="Control"/>, even if it is disabled or
        /// not visible.
        /// </summary>
        /// <param name="currentTime">The current time in milliseconds.</param>
        ///
        protected override void UpdateControl(TickCount currentTime)
        {
            base.UpdateControl(currentTime);

            if (currentTime >= _nextUpdateTime)
            {
                if (_sockets == null)
                {
                    _sockets = ClientSockets.Instance;
                }

                using (var pw = ClientPacket.GetFriends())
                {
                    _sockets.Send(pw, ClientMessageType.General);
                }

                _nextUpdateTime = (TickCount)(currentTime + _updateTimeOut);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles the ItemClicked event of the Toolbar control.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="ToolbarEventArgs"/> instance containing the event data.</param>
        void Toolbar_ItemClicked(Toolbar sender, ToolbarEventArgs e)
        {
            switch (e.ItemType)
            {
            case ToolbarItemType.Equipped:
                _equippedForm.IsVisible = !_equippedForm.IsVisible;
                break;

            case ToolbarItemType.Inventory:
                _inventoryForm.IsVisible = !_inventoryForm.IsVisible;
                break;

            case ToolbarItemType.Stats:
                _statsForm.IsVisible = !_statsForm.IsVisible;
                break;

            case ToolbarItemType.Skills:
                _skillsForm.IsVisible = !_skillsForm.IsVisible;
                break;

            case ToolbarItemType.Guild:
                _guildForm.IsVisible = !_guildForm.IsVisible;
                break;

            case ToolbarItemType.Friends:

                _friendsForm.IsVisible = !_friendsForm.IsVisible;

                using (var pw = ClientPacket.GetFriends())
                {
                    Socket.Send(pw, ClientMessageType.GUI);
                }
                break;

            case ToolbarItemType.Users:
                _onlineUsersForm.IsVisible = !_onlineUsersForm.IsVisible;
                break;
            }
        }