CheckDashboardContains() public method

public CheckDashboardContains ( object target, string propertyName ) : bool
target object
propertyName string
return bool
コード例 #1
0
        private void RefreshDashboardButton()
        {
            if (ActiveControl != propertyGrid || propertyGrid.SelectedGridItem == null ||
                !(Target is MyNode) || HasMultipleTargets)
            {
                dashboardButton.Enabled = false;
                return;
            }

            PropertyDescriptor descriptor = propertyGrid.SelectedGridItem.PropertyDescriptor;

            if (descriptor == null)
            {
                return;
            }

            if (descriptor.IsReadOnly)
            {
                dashboardButton.Enabled = false;
                return;
            }

            // A real property has been selected.
            dashboardButton.Enabled = true;
            dashboardButton.Checked = m_mainForm.CheckDashboardContains(Target, descriptor.Name);
        }
コード例 #2
0
        private void RefreshDashboardButton()
        {
            if (ActiveControl == propertyGrid && propertyGrid.SelectedGridItem != null && Target is MyNode)
            {
                PropertyDescriptor descriptor = propertyGrid.SelectedGridItem.PropertyDescriptor;
                if (descriptor == null)
                {
                    return;
                }

                if (descriptor.IsReadOnly)
                {
                    dashboardButton.Enabled = false;
                    return;
                }

                // A real property has been selected.
                dashboardButton.Enabled = true;
                dashboardButton.Checked = m_mainForm.CheckDashboardContains(Target, descriptor.Name);
            }
            else
            {
                dashboardButton.Enabled = false;
            }
        }
コード例 #3
0
ファイル: TaskForm.cs プロジェクト: orosandrei/BrainSimulator
        private void RefreshDashboardButton()
        {
            dashboardButton.Enabled = false;

            if ((listView.SelectedItems.Count != 1) || (m_nodeSelection.Count != 1))
            {
                return;
            }

            var task = CastTag(listView.SelectedItems[0].Tag)?.Task;

            if (task == null)
            {
                return;
            }

            dashboardButton.Enabled = true;
            dashboardButton.Checked = string.IsNullOrEmpty(task.TaskGroupName)
                ? m_mainForm.CheckDashboardContains(task, EnabledPropertyName)
                : m_mainForm.CheckDashboardContains(task.TaskGroup, task.TaskGroupName);
        }
コード例 #4
0
ファイル: TaskForm.cs プロジェクト: codeaudit/BrainSimulator
        private void RefreshDashboardButton()
        {
            if (listView.SelectedItems.Count == 1 && Target is MyWorkingNode)
            {
                ListViewItem selectedItem = listView.SelectedItems[0];

                var task = selectedItem.Tag as MyTask;

                dashboardButton.Enabled = true;
                if (string.IsNullOrEmpty(task.TaskGroupName))
                {
                    dashboardButton.Checked = m_mainForm.CheckDashboardContains(task, EnabledPropertyName);
                }
                else
                {
                    dashboardButton.Checked = m_mainForm.CheckDashboardContains(task.TaskGroup, task.TaskGroupName);
                }
            }
            else
            {
                dashboardButton.Enabled = false;
            }
        }