Esempio n. 1
0
        private void uiGroupsTab_GroupsManagementToolStripEdit_Click(object sender, EventArgs e)
        {
            var selectedGroup = uiGroupsTab_Groups.SelectedItem as Group;
            if (selectedGroup == null)
            {
                MessageBox.Show("Выберите группу", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            var window = new GroupForm();
            selectedGroup = window.Init(selectedGroup, Settings.OpcServers);

            uiGroupsBindingSource.DataSource = null;
            uiGroupsBindingSource.DataSource = Settings.Groups;
        }
Esempio n. 2
0
        private void uiGroupsTab_GroupsManagementToolStripAdd_Click(object sender, EventArgs e)
        {
            var window = new GroupForm();
            Group newGroup = window.Init(null, Settings.OpcServers);

            if (newGroup != null)
            {
                Settings.Groups.Add(newGroup);
                uiGroupsBindingSource.DataSource = null;
                uiGroupsBindingSource.DataSource = Settings.Groups;
            }
        }