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); } }
private void LoadGroupedProperties(ProxyPropertyDescriptor groupDescriptor) { foreach (ProxyPropertyBase proxy in GroupedDashboardViewModel.GetProperty(groupDescriptor.Proxy.PropertyId) .GroupedProperties.Select(property => property.GenericProxy)) { memberListBox.Items.Add(proxy); } }
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(); }
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(); }