/// <summary> /// get path from shell /// </summary> /// <param name="shell"></param> static void getSubPathByRecursion(DataSourceShell shell) { var items = shell.GetSubItems(); foreach (var item in items) { if (item.Path.IsNullOrEmpty()) { getSubPathByRecursion(item); } else { shellSubPaths.Add(item.Path); } } }
public static DataSourceShell GetShellItem(string parseNames) { DataSourceShell result = null; using (DataSourceShell rootShell = new DataSourceShell()) { List <DataSourceShell> rootChildren = rootShell.GetSubItems(); foreach (var item in rootChildren) { if (parseNames.Contains(item.ParsingName)) { result = item; } else { item.Dispose(); } } } return(result); }