Ejemplo n.º 1
0
        private ConnectionNodeModel CreateConnectionNode(RedisConnectionInfo connectionInfo)
        {
            var node = new ConnectionNodeModel
            {
                ConnectionName   = connectionInfo.Name,
                ConnectionString = connectionInfo.ConnectionString,
                ConnectionInfo   = connectionInfo
            };

            foreach (var server in connectionInfo.ServerInfos)
            {
                var serverNode = CreateServerNode(server);
                node.Nodes.Add(serverNode);
            }

            if (connectionInfo.DatabaseInfos.Count > 0)
            {
                var databaseGroupNode = CreateDatabaseGroupNode(connectionInfo);
                node.Nodes.Add(databaseGroupNode);
            }

            if (node.Nodes.Count > 0)
            {
                node.IsExpanded = true;
                node.IsOpen     = true;
            }

            return(node);
        }
Ejemplo n.º 2
0
 public ConnectionNodeController(
     ConnectionNodeModel model)
     : this(
         Locator.Current.GetService <IDialogManager>(),
         Locator.Current.GetService <IConnectionProvider>(),
         Locator.Current.GetService <IClientAccessor>())
 {
     _model = model;
 }