Пример #1
0
        private static void addFilters(FileTree tree, XmlNodeList nodes, bool isDir)
        {
            foreach (XmlNode node in nodes)
            {
                String incl = XmlUtils.ReadStr(node, "@incl", null);
                String excl = XmlUtils.ReadStr(node, "@excl", null);
                if (incl == null && excl == null)
                {
                    throw new BMNodeException(node, "At least 1 of the attributes incl or excl must be present.");
                }

                if (incl != null)
                {
                    if (isDir)
                    {
                        tree.AddDirFilter(incl, true);
                    }
                    else
                    {
                        tree.AddFileFilter(incl, true);
                    }
                }

                if (excl != null)
                {
                    if (isDir)
                    {
                        tree.AddDirFilter(excl, false);
                    }
                    else
                    {
                        tree.AddFileFilter(excl, false);
                    }
                }
            }
        }