Example #1
0
        private void ShowSummary(KnowledgeView view)
        {
            var userFiles = AppCore.Workspace.UserFiles
                            .Select(f => new NameValuePair <string>(f.Name, f.Path)).ToArray();
            var artFiles = KbContext.CurrentKb.ManagerFileInclude.GetByKnowledgeID(view.KnowledgeId)
                           .Select(f => new NameValuePair <string>(f.FileName, Path.Combine(view.FilesDir, f.FileName))).ToArray();


            boxSummary.UserFiles    = userFiles;
            boxSummary.ArticleFiles = artFiles;
            boxSummary.Value        = view.Summary;
        }
Example #2
0
            private IFile CreateKnowledgeFile(string filename)
            {
                Guid publicId;

                if (!Guid.TryParse(Path.GetFileNameWithoutExtension(filename), out publicId))
                {
                    return(null);
                }

                var knowledge = KbContext.CurrentKb.ManagerKnowledge.GetByPublicID(publicId);

                if (knowledge == null)
                {
                    return(null);
                }
                var view = new KnowledgeView(knowledge);

                return(new DriveFile(view.GetContentServerPath(), this));
            }