public void ShowContextMenuProperly() { showEventInvoked = false; contextMenu.Show(); Assert.IsTrue(contextMenu.gameObject.activeSelf, "The context menu should be visible."); Assert.IsTrue(showEventInvoked); }
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); }
//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); } } }
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(); }
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); }
private void OnOpenContextMenu(ChatEntry chatEntry) { contextMenu.transform.position = chatEntry.contextMenuPositionReference.position; contextMenu.transform.parent = this.transform; contextMenu.Show(chatEntry.model.senderId); }
void OnUserContextMenu(Vector3 position, string userId) { contextMenu.transform.position = position; contextMenu.Show(userId); }