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; }
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); }
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); }