private void MainFormLoad(object sender, EventArgs e)
        {
            PluginHost pluginHost = new PluginHost();

            _handlers = pluginHost.Handlers;
            AvailableHandlersTreeView.Nodes.AddRange(TreeNodeMapper.MapHandlers(_handlers));
            AvailableHandlersTreeView.SelectedNode = AvailableHandlersTreeView.Nodes[0];

            _knownTypes = pluginHost.KnownTypes;

            _config = new TransportAgentConfig();

            ConfigurationTreeView.Nodes.Add(TreeNodeMapper.MapTransportAgentConfig(_config));
        }
        private void LoadButtonClick(object sender, EventArgs e)
        {
            if (DialogResult.OK == OpenConfigFileDialog.ShowDialog())
            {
                _configFilename = OpenConfigFileDialog.FileName;

                var serializer = new DataContractSerializer(typeof(TransportAgentConfig), _knownTypes);
                var settings   = new XmlReaderSettings {
                    ConformanceLevel = ConformanceLevel.Auto,
                };

                using (var reader = XmlReader.Create(_configFilename, settings))
                {
                    _config = (TransportAgentConfig)serializer.ReadObject(reader, true);
                }

                ConfigurationTreeView.Nodes.Clear();
                ConfigurationTreeView.Nodes.Add(TreeNodeMapper.MapTransportAgentConfig(_config));
            }
        }