示例#1
0
        public static CassetteInfo LoadCassette(string cassetteFolder, bool loaddata)
        {
            //var cassetteFolder = cassettePath.Value;
            if (!Directory.Exists(cassetteFolder) || (!File.Exists(cassetteFolder + "cassette.finfo") && false))
            {
                return(null);
            }
            var cassette     = new Cassette(cassetteFolder, loaddata);
            var cassetteInfo =
                new CassetteInfo
            {
                fullName = "iiss://" + cassette.Name + "@iis.nsk.su",
                cassette = cassette,
                url      = cassette.Dir.FullName + '/',
                docsInfo = !loaddata ? new List <factograph.RDFDocumentInfo>() :
                           cassette
                           .DataDocuments()
                           .Select(xDoc => new RDFDocumentInfo(xDoc, cassetteFolder))
                           .ToList()
            };

            if (loaddata)
            {
                cassetteInfo.docsInfo.Add(new RDFDocumentInfo(cassette));
            }
            return(cassetteInfo);
        }
示例#2
0
        public static CassetteInfo LoadCassette(string cassetteFolder, bool loaddata)
        {
            //var cassetteFolder = cassettePath.Value;
            //if (!Directory.Exists(cassetteFolder) || (!File.Exists(cassetteFolder + "cassette.finfo"))) return null;
            var cassette = new Cassette(cassetteFolder, loaddata);
            List<RDFDocumentInfo> di_list = null;
            if (loaddata)
            {
                di_list = new List<RDFDocumentInfo>();
                var dd = cassette.DataDocuments().ToList();
                foreach (var xDoc in dd)
                {
                    di_list.Add(
                        new RDFDocumentInfo(xDoc, cassetteFolder));
                }
            }

            var cassetteInfo =
                new CassetteInfo
                {
                    fullName = "iiss://" + cassette.Name + "@iis.nsk.su",
                    cassette = cassette,
                    url = cassette.Dir.FullName + '/',
                    docsInfo = di_list,
                    loaddata = loaddata
                };
            if (loaddata) cassetteInfo.docsInfo.Add(new RDFDocumentInfo(cassette));
            return cassetteInfo;
        }