Ejemplo n.º 1
0
        private void uiCreate_Click(object sender, EventArgs e)
        {
            if (uiGroupName.Text == string.Empty)
            {
                MessageBox.Show("Введите имя группы", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (_group == null)
            {
                _group = new Group();
            }

            _group.GroupName = uiGroupName.Text;
            _group.OpcServer = uiOpcServer.SelectedItem as OpcServer;
            _group.RefreshInterval = uiRefreshInterval.Value;
            _group.Description = uiDescription.Text;
            _group.IsActive = uiIsActive.Checked;

            this.Close();
        }
Ejemplo n.º 2
0
        public Group Init(Group group, List<OpcServer> opcServers)
        {
            _group = group;
            _opcServers = opcServers;

            if (group == null)
            {
                uiCreate.Text = "Создать";
            }
            else
            {
                uiGroupName.Text = group.GroupName;
                uiOpcServer.SelectedItem = group.OpcServer;
                uiRefreshInterval.Value = group.RefreshInterval;
                uiDescription.Text = group.Description;
                uiIsActive.Checked = group.IsActive;

                uiCreate.Text = "Изменить";
            }

            this.ShowDialog();
            return _group;
        }