Exemplo n.º 1
0
        public CallGenClient(SynchronizationContext syncContext, ConfigManager cfgManager)
        {
            _cfgManager = cfgManager;
              _syncContext = syncContext;

              _clientSocket = new Socket(AddressFamily.InterNetwork,
                                SocketType.Stream,
                                ProtocolType.Tcp)
                        {
                          Blocking = false
                        };

              _clientThread = new Thread(ClientThreadProc);

              _commands = Queue.Synchronized(new Queue());

              _ip = null;
              _port = 0;

              _runningLock = new ReaderWriterLockSlim();
              _incomingDataAccumulator = new StringBuilder();

              Running = false;

              _callAckStopwatch = new Stopwatch();
              _cancelAckStopwatch = new Stopwatch();
        }
Exemplo n.º 2
0
        public DlgConfig(ConfigManager cfgMng)
            : this()
        {
            _cfgMng = cfgMng;
              Config = _cfgMng.Config;

             UpdateView();
        }
Exemplo n.º 3
0
        public bool Init(SynchronizationContext context)
        {
            _ctx = context;

              ConfigMng = new ConfigManager();

              ClientMng = new ClientMng(_ctx, ConfigMng.Config);

              CallGenClient = new CallGenClient(context, ConfigMng);

              return true;
        }
Exemplo n.º 4
0
        public DlgMngConfig(ConfigManager configMng)
        {
            InitializeComponent();
              ConfigManager = configMng;

              lblCurrentConfig.Text = "In use: " + (Settings.Default.Config ?? "default");

              if (!Directory.Exists(Settings.Default.TestConfigDirectory))
            return;

              string[] files = Directory.GetFiles(Settings.Default.TestConfigDirectory);

              if (files.Length == 0)
            return;

              foreach (string file in files)
              {
            if(file != null)
            {
              string filename = Path.GetFileName(file);
              string extension = Path.GetExtension(filename);

              if (filename != null && extension != null && extension.ToLower() == Settings.Default.TestConfigFileExtension)
              {
            ConfigListBox.Items.Add(filename.ToLower());

            if (!string.IsNullOrEmpty(Settings.Default.Config))
            {
              string filenameWithoutExtension = Path.GetFileNameWithoutExtension(filename.ToLower());
              string activeConfigWithoutExtension = Settings.Default.Config;

              if(activeConfigWithoutExtension.Equals(filenameWithoutExtension))
                ConfigListBox.SelectedIndex = ConfigListBox.Items.Count - 1;
            }
              }
            }
              }

              ConfigListBox.Update();
        }