Пример #1
0
        protected override void GetChildItems(string path, bool recurse)
        {
            if (PathIsDrive(path))
            {
                NodeDetail thisNode = new NoSDbDetail(null, this.PSDriveInfo);
                WriteItemObject("\n    Context: " + path + "\n", path, false);
                PrintableTable childs = thisNode.ChilderanTable;
                WriteItemObject(childs.GetTableRows(), path, false);
                WriteItemObject("", path, false);
            }
            else
            {
                try
                {
                    ConfigurationConnection.UpdateClusterConfiguration();
                    ConfigurationConnection.UpdateDatabaseClusterInfo();
                }
                catch (Exception ex)
                {
                    throw ex;
                }


                string[]   pathChunks = SplitPath(path);
                NodeDetail thisNode;
                if (new NoSDbDetail(pathChunks, this.PSDriveInfo).TryGetNodeDetail(out thisNode))
                {
                    WriteItemObject("\n    Context: " + path + "\n", path, false);
                    PrintableTable childs = thisNode.ChilderanTable;
                    WriteItemObject(childs.GetTableRows(), path, false);
                    WriteItemObject("", path, false);
                }
            }
        }
Пример #2
0
        private bool TryGetParentDetail(string path, out NodeDetail thisNode)
        {
            string[] pathChunks = SplitPath(path);
            if (pathChunks.Length == 1)
            {
                thisNode = new NoSDbDetail(null, PSDriveInfo);
                return(true);
            }
            var parentChunks = new string[pathChunks.Length - 1];

            Array.Copy(pathChunks, 0, parentChunks, 0, pathChunks.Length - 1);
            return(new NoSDbDetail(parentChunks, PSDriveInfo).TryGetNodeDetail(out thisNode));
        }