private string[] ProcessItem(object o)
        {
            UniqueStringCollection deps = new UniqueStringCollection();

            if (o is TagReference)
            {
                TagReference tagRef = (o as TagReference);
                if (tagRef.Value != null)
                {
                    if (tagRef.Value.Length > 0)
                    {
                        string filename = tagRef.Value + TagFileName.GetFileExtension(tagRef.TagGroup);
                        deps.Add(filename);
                    }
                }
            }
            if (o is CollectionBase)
            {
                foreach (object child in (o as CollectionBase))
                {
                    if (child is IBlock)
                    {
                        string[] items = ProcessDependencies(child as IBlock);
                        deps.AddRange(items);
                    }
                }
            }
            if (o is IBlock)
            {
                string[] items = ProcessDependencies(o as IBlock);
                deps.AddRange(items);
            }
            return(deps.ToArray());
        }
        private string[] ProcessDependencies(IBlock block)
        {
            // Get all of the dependencies.
            UniqueStringCollection deps = new UniqueStringCollection();

            PropertyInfo[] properties = block.GetType().GetProperties();
            foreach (MemberInfo info in properties)
            {
                object o = (info as PropertyInfo).GetValue(block, null);
                deps.AddRange(ProcessItem(o));
            }

            FieldInfo[] fields = block.GetType().GetFields();
            foreach (MemberInfo info in fields)
            {
                object o = (info as FieldInfo).GetValue(block);
                deps.AddRange(ProcessItem(o));
            }

            return(deps.ToArray());
        }