private void InitializeModems()
        {
            int width = 0;

            foreach (var operatorModemPort in _operatorModemInfos)
            {
                Console.WriteLine($@"{operatorModemPort.ComPort} -- {operatorModemPort.OperatorName} -- {operatorModemPort.MobileNumber}");
                var operatorControl = new OperatorControl(operatorModemPort.ComPort, operatorModemPort.OperatorName, operatorModemPort.MobileNumber)
                {
                    Visible = true,
                    Top     = 0,
                    Left    = 0 + width,
                };
                width = operatorControl.Width + 5;
                PanelModemConnection.Controls.Add(operatorControl);
                operators.Add(operatorControl);
            }
        }
예제 #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            OperatorControl demo = new OperatorControl();

            this.stackPanel1.Children.Add(demo);
        }