Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 static Examples()
 {
     _rootExample = new RootExample(typeof(Examples).Namespace);
 }