示例#1
0
        private int[] getCounts(IVirtualDirectory subroot, int[] subRoots)
        {
            var index = subroot.GetFile("Index.xml");
            XmlSerializer ser = new XmlSerializer(typeof(Root));
            var o = ser.Deserialize(index.Open());
            var root =  o as Root;

            if (subRoots == null || subRoots.Length == 0)
                subRoots = Enumerable.Range(0, root.Groups).ToArray();

            return subRoots;
        }
示例#2
0
        public static IVirtualFile GetDefaultDocument(this IVirtualDirectory dir, List <string> defaultDocuments)
        {
            foreach (var defaultDoc in defaultDocuments)
            {
                var defaultFile = dir.GetFile(defaultDoc);
                if (defaultFile == null)
                {
                    continue;
                }

                return(defaultFile);
            }

            return(null);
        }
示例#3
0
        public static IVirtualFile GetDefaultDocument(this IVirtualDirectory dir)
        {
            foreach (var defaultDoc in HostContext.Config.DefaultDocuments)
            {
                var defaultFile = dir.GetFile(defaultDoc);
                if (defaultFile == null)
                {
                    continue;
                }

                return(defaultFile);
            }

            return(null);
        }