コード例 #1
0
        private void addToGroupButton_Click(object sender, EventArgs e)
        {
            // This can be null if the category was selected.
            var selectedPropertyDescriptor = propertyGrid.SelectedGridItem.PropertyDescriptor as ProxyPropertyDescriptor;

            if (selectedPropertyDescriptor == null)
            {
                return;
            }

            DashboardNodePropertyBase property = DashboardViewModel.GetProperty(selectedPropertyDescriptor.Proxy.PropertyId);

            ProxyPropertyDescriptor selectedGroupDescriptor = GetCurrentGroupDescriptor();
            DashboardPropertyGroup  groupProperty           =
                GroupedDashboardViewModel.GetProperty(selectedGroupDescriptor.Proxy.PropertyId);

            try
            {
                groupProperty.Add(property);

                SetPropertyGridButtonsEnabled(false);
                RefreshAll();

                m_mainForm.ProjectStateChanged(string.Format("Dashboard property {0} added to group: {1}",
                                                             property.DisplayName, groupProperty.DisplayName));
            }
            catch (InvalidOperationException)
            {
                errorText.Text = string.Format("Cannot add a {0} property to a {1} group",
                                               selectedPropertyDescriptor.Proxy.TypeName,
                                               selectedGroupDescriptor.Proxy.TypeName);
            }
        }
コード例 #2
0
 private void LoadGroupedProperties(ProxyPropertyDescriptor groupDescriptor)
 {
     foreach (ProxyPropertyBase proxy in GroupedDashboardViewModel.GetProperty(groupDescriptor.Proxy.PropertyId)
              .GroupedProperties.Select(property => property.GenericProxy))
     {
         memberListBox.Items.Add(proxy);
     }
 }
コード例 #3
0
        private void editGroupButton_Click(object sender, EventArgs e)
        {
            ProxyPropertyDescriptor descriptor = GetCurrentGroupDescriptor();

            var dialog = new DashboardGroupNameDialog(propertyGridGrouped,
                                                      GroupedDashboardViewModel.GetProperty(descriptor.Proxy.PropertyId),
                                                      m_mainForm.Project.GroupedDashboard);

            dialog.ShowDialog();
        }
コード例 #4
0
        private void removeGroupButton_Click(object sender, EventArgs e)
        {
            ProxyPropertyDescriptor descriptor = GetCurrentGroupDescriptor();

            GroupedDashboardViewModel.RemoveProperty(descriptor.Proxy);
            propertyGrid.Refresh();
            memberListBox.Items.Clear();

            m_mainForm.ProjectStateChanged(string.Format("Dashboard property group removed: {0}", descriptor.Name));
        }
コード例 #5
0
        private void OnGroupPropertyValueChanged(object s, PropertyValueChangedEventArgs e)
        {
            ProxyPropertyDescriptor descriptor = GetCurrentGroupDescriptor();

            foreach (MyNode node in GroupedDashboardViewModel.GetProperty(descriptor.Proxy.PropertyId).GroupedProperties.Select(member => member.Node))
            {
                RefreshNode(node);
            }

            RefreshAll();
        }
コード例 #6
0
        private void addGroupButton_Click(object sender, EventArgs e)
        {
            GroupedDashboardViewModel.AddGroupedProperty();

            m_mainForm.ProjectStateChanged("Dashboard property group added");
        }
コード例 #7
0
 public void SetDashboards(Dashboard dashboard, GroupDashboard groupedDashboard)
 {
     DashboardViewModel        = new DashboardViewModel(dashboard);
     GroupedDashboardViewModel = new GroupedDashboardViewModel(groupedDashboard);
 }