public ZipArchiving(String newArchiveName, ZipFileModel zipFileModel, SerializableTreeNode serializableTreeNode)
 {
     this.NewArchiveName       = newArchiveName;
     this.ZipFileModelSource   = zipFileModel;
     this.SerializableTreeNode = serializableTreeNode;
     PrepareEventsVariablesArgs();
 }
 public TableauReportViewModel(IReportVisual reportVisual, SerializableTreeNode <ReportVisualFolder> relatedReports = null)
 {
     Id            = reportVisual.Id;
     WorkbookName  = reportVisual.Parameters.SingleOrDefault(p => p.Key == nameof(WorkbookName)).Value;
     ViewName      = reportVisual.Parameters.SingleOrDefault(p => p.Key == nameof(ViewName)).Value;
     WorksheetName = reportVisual.Parameters.SingleOrDefault(p => p.Key == nameof(WorksheetName)).Value;
     FolderName    = reportVisual.FolderName;
     Description   = reportVisual.Description;
     Title         = reportVisual.Title;
     if (reportVisual.RenderingAttributes != null)
     {
         RenderingAttributes = reportVisual.RenderingAttributes.Value;
     }
     RelatedReports = relatedReports;
 }
Example #3
0
        SerializableTreeNode <Note> INoteService.GetNoteNodes(IRdbDataEntity entityWithAttachedNotes)
        {
            var notes = Rdb.GetAttachedNotes(entityWithAttachedNotes).Include(z => z.CreatedByContact);
            var root  = new SerializableTreeNode <Note>(null);

            foreach (var note in notes)
            {
                var currentNoteNode = new SerializableTreeNode <Note>(note);
                if (note.ParentNoteId != null)
                {
                    SerializableTreeNode <Note> parentNoteNode = null;

                    //find parent in root and add child to it
                    root.Walk((node, depth) =>
                    {
                        if (node.Data?.NoteId == note.ParentNoteId)
                        {
                            node.Add(currentNoteNode);
                            parentNoteNode = node;
                            return;
                        }
                    });

                    //parent isn't in root
                    if (parentNoteNode == null)
                    {
                        var parentNote = notes.SingleOrDefault(x => x.NoteId == note.ParentNoteId);
                        parentNoteNode = new SerializableTreeNode <Note>(parentNote);
                        parentNoteNode?.Add(currentNoteNode);
                    }
                }
                else
                {
                    root.Add(currentNoteNode);
                }
            }

            root.Children = root.Children.OrderBy(x => x.Data.CreatedAtUtc).ToList();
            return(root);
        }
Example #4
0
        private SerializableTreeNode <ReportVisualFolder> GetTreeCacheEntry(ReportSearchCriteria reportSearchCriteria, string topLevelFolderName)
        {
            var root          = new SerializableTreeNode <ReportVisualFolder>(new ReportVisualFolder(topLevelFolderName));
            var reportVisuals = GetReportVisuals(reportSearchCriteria) as ICollection <IReportVisual> ?? GetReportVisuals(reportSearchCriteria).ToList();

            if (reportVisuals.Any())
            {
                var workbookFolders = new HashSet <SerializableTreeNode <ReportVisualFolder> >();
                foreach (var rv in reportVisuals)
                {
                    var visual     = rv as ReportVisual;
                    var folderName = rv.FolderName;

                    var existingFolder = workbookFolders.SingleOrDefault(x => x.Data.Title == folderName);

                    if (existingFolder != null)
                    {
                        existingFolder.Data.Reports.Add(visual);
                    }
                    else if (folderName == "")
                    {
                        root.Data.Reports.Add(visual);
                    }
                    else
                    {
                        var newWorkbookFolder = new SerializableTreeNode <ReportVisualFolder>(new ReportVisualFolder(folderName));
                        newWorkbookFolder.Data.Reports.Add(visual);
                        workbookFolders.Add(newWorkbookFolder);
                    }
                }

                foreach (var folder in workbookFolders)
                {
                    root.Add(folder);
                }
            }
            return(new CacheEntry <SerializableTreeNode <ReportVisualFolder> >(root).Value);
        }
 public void SetTreeViewZipFileStructureForFileWriting(TreeNodeExtended treeNodeExtended)
 {
     treeViewZipFileStructure = SerializableTreeViewOperation.fnPrepareToWrite(treeNodeExtended);
 }
 public ZipFileModel(TreeNodeExtended treeNodeExtended, FileNameCreator fileNameCreator)
 {
     this.fileNameCreator          = fileNameCreator;
     this.treeViewZipFileStructure = new SerializableTreeNode();
     SetTreeViewZipFileStructureForFileWriting(treeNodeExtended);
 }
 public ZipFileModel()
 {
     this.treeViewZipFileStructure = new SerializableTreeNode();
 }