private void SaveAndClose()
        {
            string newName = groupNameText.Text;

            if (!m_dashboard.CanChangeName(m_group, newName))
            {
                return;
            }

            m_group.PropertyName = newName;
            m_sourceGrid.Refresh();
            Close();
        }
Пример #2
0
        public void ChecksNameUniqueness()
        {
            var dashboard = new GroupDashboard();

            dashboard.Add();
            dashboard.Add();

            var group1 = dashboard.Properties[0];
            var group2 = dashboard.Properties[1];

            group1.PropertyName = "a";
            group2.PropertyName = "b";

            Assert.True(dashboard.CanChangeName(group1, "a"));
            Assert.False(dashboard.CanChangeName(group1, "b"));
        }