public CommandHistoryManager(SystemConfig3 config)
        {
            _config = config;

            _itemsFolder = SbmqSystem.AppDataPath + @"\savedCommands\";
            _itemsFileV2 = SbmqSystem.AppDataPath + "savedCommands.dat";
            _itemsFile   = SbmqSystem.AppDataPath + "savedCommands3.dat";

            if (!Directory.Exists(_itemsFolder))
            {
                Directory.CreateDirectory(_itemsFolder);
            }
        }
        public ConfigWindow(SbmqSystem system, bool showSendCommand = false)
        {
            InitializeComponent();

            Topmost = SbmqSystem.UIState.AlwaysOnTop;

            _sys    = system;
            _config = system.Config;


            _managerTypes = ServiceBusFactory.AvailableServiceBusManagers();


            cbContentFormat.ItemsSource  = _managerTypes[0].MessageContentTypes;
            cbContentFormat.SelectedItem = _config.CurrentServer.CommandContentType;

            cShowOnNewMessages.IsChecked = _config.ShowOnNewMessages;
            cCheckForNewVer.IsChecked    = _config.VersionCheck.Enabled;
            cStartOnWinStartup.IsChecked = GetStartOnWinStartupState();


            BindServers(_config.Servers);

            SelectServer(_config.MonitorServerName, false);

            //tbServer.Init(string.Empty, typeof(string), false);
            //tbServer.Visibility = System.Windows.Visibility.Hidden;

            BindSendCommandView(_config.CurrentServer);

            UpdateSendCommandInfo(false);
            UpdateQueueuInfo(false);

            if (showSendCommand)
            {
                scroller.ScrollToBottom();
            }
        }