Пример #1
0
    public void ShowContextMenuProperly()
    {
        showEventInvoked = false;
        contextMenu.Show();

        Assert.IsTrue(contextMenu.gameObject.activeSelf, "The context menu should be visible.");
        Assert.IsTrue(showEventInvoked);
    }
Пример #2
0
    public virtual bool CreateEntry(string userId)
    {
        if (entries.ContainsKey(userId))
        {
            return(false);
        }

        PoolableObject newFriendEntry = friendEntriesPool.Get();

        instantiatedFriendEntries.Add(userId, newFriendEntry);
        var entry = newFriendEntry.gameObject.GetComponent <FriendEntryBase>();

        entries.Add(userId, entry);

        entry.OnMenuToggle += (x) =>
        {
            var  ownUserProfiler = UserProfile.GetOwnUserProfile();
            bool isBlocked       = ownUserProfiler.blocked != null?ownUserProfiler.blocked.Contains(userId) : false;

            contextMenuPanel.Initialize(userId, string.Empty, isBlocked);
            contextMenuPanel.transform.position = entry.menuPositionReference.position;
            contextMenuPanel.Show();
        };

        UpdateEmptyListObjects();

        return(true);
    }
Пример #3
0
 //context menu
 private void ViewerListView_MouseClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         if (ViewerListView.FocusedItem.Bounds.Contains(e.Location) == true)
         {
             UserContextMenu.Show(Cursor.Position);
         }
     }
 }
Пример #4
0
    private void OnOpenContextMenu(ChatEntry chatEntry)
    {
        bool isBlocked = UserProfile.GetOwnUserProfile().blocked.Contains(chatEntry.model.senderId);

        contextMenu.Initialize(
            chatEntry.model.senderId,
            chatEntry.model.senderName,
            isBlocked);

        contextMenu.transform.position = chatEntry.contextMenuPositionReference.position;
        contextMenu.transform.parent   = this.transform;
        contextMenu.Show();
    }
Пример #5
0
    public void ShowContextMenuProperly()
    {
        bool   showEventCalled = false;
        Action onShow          = () => showEventCalled = true;

        contextMenu.OnShowMenu += onShow;

        contextMenu.Show(TEST_USER_ID);

        contextMenu.OnShowMenu -= onShow;
        Assert.IsTrue(contextMenu.gameObject.activeSelf, "The context menu should be visible.");
        Assert.IsTrue(showEventCalled);
    }
    protected virtual bool CreateEntry(string userId)
    {
        if (entries.ContainsKey(userId))
        {
            return(false);
        }

        PoolableObject newFriendEntry = friendEntriesPool.Get();

        instantiatedFriendEntries.Add(userId, newFriendEntry);
        var entry = newFriendEntry.gameObject.GetComponent <FriendEntryBase>();

        entries.Add(userId, entry);

        entry.OnMenuToggle += (x) =>
        {
            contextMenuPanel.transform.position = entry.menuPositionReference.position;
            contextMenuPanel.Show(userId);
        };

        UpdateEmptyListObjects();
        return(true);
    }
Пример #7
0
 private void OnOpenContextMenu(ChatEntry chatEntry)
 {
     contextMenu.transform.position = chatEntry.contextMenuPositionReference.position;
     contextMenu.transform.parent   = this.transform;
     contextMenu.Show(chatEntry.model.senderId);
 }
Пример #8
0
 void OnUserContextMenu(Vector3 position, string userId)
 {
     contextMenu.transform.position = position;
     contextMenu.Show(userId);
 }