Ejemplo n.º 1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            // изменение настроек в соответствии с элементами управления
            if (modified)
            {
                settings.Behavior = cbBehavior.ParseText <CommChannelLogic.OperatingBehaviors>();
                settings.ConnMode = (CommTcpChannelLogic.ConnectionModes)cbConnMode.GetSelectedItem(
                    new Dictionary <int, object>()
                {
                    { 0, CommTcpChannelLogic.ConnectionModes.Individual },
                    { 1, CommTcpChannelLogic.ConnectionModes.Shared }
                });
                settings.DevSelMode = (CommTcpServerLogic.DeviceSelectionModes)cbDevSelMode.GetSelectedItem(
                    new Dictionary <int, object>()
                {
                    { 0, CommTcpServerLogic.DeviceSelectionModes.ByIPAddress },
                    { 1, CommTcpServerLogic.DeviceSelectionModes.ByFirstPackage },
                    { 2, CommTcpServerLogic.DeviceSelectionModes.ByDeviceLibrary }
                });
                settings.TcpPort      = Convert.ToInt32(numTcpPort.Value);
                settings.InactiveTime = Convert.ToInt32(numInactiveTime.Value);

                settings.SetCommCnlParams(commCnlParams);
            }

            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Установить параметры канала связи по умолчанию
 /// </summary>
 public override void SetCommCnlParamsToDefault(SortedList <string, string> commCnlParams)
 {
     CommTcpServerLogic.Settings settings = new CommTcpServerLogic.Settings();
     settings.SetCommCnlParams(commCnlParams);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Установить параметры канала связи по умолчанию
 /// </summary>
 public override void SetCommCnlParamsToDefault(SortedList<string, string> commCnlParams)
 {
     CommTcpServerLogic.Settings settings = new CommTcpServerLogic.Settings();
     settings.SetCommCnlParams(commCnlParams);
 }