protected virtual void DeleteValidateContextMenuCmd(MenuItemValidationArgs args) { if (m_treeView.SelectedItem == null || !m_treeView.SelectedItems.OfType <ExposeToEditor>().Any(o => o.CanDelete)) { args.IsValid = false; } }
protected virtual void DuplicateValidateContextMenuCmd(MenuItemValidationArgs args) { if (m_listBox.SelectedItems == null) { args.IsValid = false; } }
protected virtual void RenameValidateContextMenuCmd(MenuItemValidationArgs args) { if (m_treeView.SelectedItem == null || !((ExposeToEditor)m_treeView.SelectedItem).CanRename) { args.IsValid = false; } }
private void DuplicateValidate(MenuItemValidationArgs args) { if (m_listBox.SelectedItems == null || m_listBox.SelectedItems.OfType <AssetItem>().FirstOrDefault() == null) { args.IsValid = false; } }
protected virtual void DuplicateValidateContextMenuCmd(MenuItemValidationArgs args) { if (m_listBox.SelectedItems == null || m_listBox.SelectedItems.OfType <AssetItem>().FirstOrDefault() == null) { args.IsValid = false; } }
private void OpenValidate(MenuItemValidationArgs args) { ProjectItem selectedItem = (ProjectItem)m_listBox.SelectedItem; if (m_listBox.SelectedItemsCount != 1 || !selectedItem.IsFolder && !m_project.IsScene(selectedItem)) { args.IsValid = false; } }
private void CreateValidate(MenuItemValidationArgs args) { ProjectItem selectedItem = (ProjectItem)m_listBox.SelectedItem; if (selectedItem != null && !selectedItem.IsFolder) { args.IsValid = false; } }
protected virtual void CreateValidateContextMenuCmd(MenuItemValidationArgs args) { ProjectItem selectedItem = (ProjectItem)m_listBox.SelectedItem; if (selectedItem != null && !selectedItem.IsFolder) { args.IsValid = false; } }
public void CmdCreateWindowValidate(MenuItemValidationArgs args) { #if !(UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN || UNITY_WSA) if (args.Command.ToLower() == RuntimeWindowType.ImportFile.ToString().ToLower()) { args.IsVisible = false; } #endif }
private void OpenValidate(MenuItemValidationArgs args) { ProjectItem selectedItem = (ProjectItem)m_listBox.SelectedItem; ProjectTreeCancelEventArgs cancelArgs = new ProjectTreeCancelEventArgs(new[] { selectedItem }); if (m_listBox.SelectedItemsCount != 1 || !selectedItem.IsFolder && !m_project.IsScene(selectedItem)) { cancelArgs.Cancel = true; } if (ValidateContextMenuOpenCommand != null) { ValidateContextMenuOpenCommand(this, cancelArgs); } args.IsValid = !cancelArgs.Cancel; }
protected MenuItemValidationArgs IsValid() { if (m_item == null) { return(new MenuItemValidationArgs(m_item.Command) { IsValid = false, IsVisible = false }); } if (m_item.Validate == null) { return(new MenuItemValidationArgs(m_item.Command) { IsValid = true, IsVisible = true }); } MenuItemValidationArgs args = new MenuItemValidationArgs(m_item.Command); m_item.Validate.Invoke(args); return(args); }
public void CmdGameObjectValidate(MenuItemValidationArgs args) { args.IsValid = CmdGameObjectValidate(args.Command); }
protected virtual void RenameValidateContextMenuCmd(MenuItemValidationArgs args) { VirtualizingTreeViewItem treeViewItem = m_treeView.GetTreeViewItem(m_treeView.SelectedItem); args.IsValid = treeViewItem != null && treeViewItem.CanEdit; }
protected virtual void DeleteFolderValidateContextMenuCmd(MenuItemValidationArgs args) { }
protected virtual void DuplicateValidateContextMenuCmd(MenuItemValidationArgs args) { args.IsValid = TreeView.SelectedItem != null; }
protected virtual void RenameValidateContextMenuCmd(MenuItemValidationArgs args) { }
public void CanExecuteMenuCommand(MenuItemValidationArgs args) { args.IsValid = m_currentGame.CanExecuteMenuCommand(args.Command); }
public void CmdEditValidate(MenuItemValidationArgs args) { args.IsValid = CmdEditValidate(args.Command); }