private bool IsUpdateRecursive(ExampleBase example) { if (example is FolderExample) { FolderExample childFolderExample = example as FolderExample; foreach (var item in childFolderExample.Children) { if (item.IsUpdate || item.IsNew) { return(true); } if (IsUpdateRecursive(item)) { return(true); } } } else if (example.IsUpdate || example.IsNew) { return(true); } return(false); }
private ExampleBase FindExample(ExampleBase example, string id) { if (example.ID == id) { return(example); } FolderExample folderExample = example as FolderExample; if (folderExample != null) { foreach (var child in folderExample.Children) { ExampleBase result = this.FindExample(child, id); if (result != null) { return(result); } } } return(null); }
static Examples() { _rootExample = new RootExample(typeof(Examples).Namespace); }