Example #1
0
        private void btnAddConnect_Click(object sender, RoutedEventArgs e)
        {
            AddRedisConnWin win = new AddRedisConnWin();

            win.Owner    = this;
            win.ShowType = 0;
            win.Closing += AddRedisConnWin_Closing;
            win.ShowDialog();
            e.Handled = true;
        }
Example #2
0
        private void AddRedisConnWin_Closing(object sender, CancelEventArgs e)
        {
            AddRedisConnWin win = sender as AddRedisConnWin;

            if (win.Tag != null && win.Tag.GetType().Name == "RedisConnConfig")
            {
                RedisConnConfig config = win.Tag as RedisConnConfig;
                if (win.ShowType == 0)
                {
                    Common.ConnConfigList.Add(config.ConnName, config);
                    nodes.Add(new Node {
                        Name = config.ConnName, NodeType = NodeType.Connnection
                    });
                }
                else
                {
                    Common.ConnConfigList[config.ConnName] = config;
                    (tvConn.SelectedItem as Node).Name     = config.ConnName;
                }
                RedisHelper.WriteConnList(Common.ConnConfigList);
            }
        }