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 removeButton_Click(object sender, EventArgs e) { ProxyPropertyDescriptor descriptor = GetCurrentPropertyDescriptor(); DashboardViewModel.RemoveProperty(descriptor.Proxy); m_mainForm.ProjectStateChanged(string.Format("Dashboard property removed: {0}", descriptor.Name)); }
private void OnPropertyValueChanged(object s, PropertyValueChangedEventArgs e) { ProxyPropertyDescriptor descriptor = GetCurrentPropertyDescriptor(); MyNode node = DashboardViewModel.GetProperty(descriptor.Proxy.PropertyId).Node; RefreshNode(node); RefreshAll(); }
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 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)); }
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(); }
public void DescriptorHasCorrectType() { var node = new Node(); var property = GetDirectProperty(node); var proxy = property.GenericProxy; var descriptor = new ProxyPropertyDescriptor(ref proxy, new Attribute[0]); Assert.Equal(descriptor.PropertyType, typeof(string)); }
public void GroupDescriptorHasCorrectType() { var node = new Node(); var property = GetDirectProperty(node); var group = new DashboardPropertyGroup("Foo"); group.Add(property); var proxy = group.GenericProxy; var descriptor = new ProxyPropertyDescriptor(ref proxy, new Attribute[0]); Assert.Equal(descriptor.PropertyType, typeof(string)); }