Beispiel #1
0
        public void Watch(FolderDetails folder)
        {
            this.WatchedFolder = folder;
            this.watching      = true;

            this.timer = new Timer(this.CheckForFolderChanges, null, 1000, PollingInterval);
        }
Beispiel #2
0
        public void CreationTest()
        {
            FolderDetails testFolder = new FolderDetails {
                Path = _tempFolderPath
            };

            Assert.NotNull(testFolder);
        }
Beispiel #3
0
        public void FilesInFolderTest(int filesCount)
        {
            MakeTempFolder(filesCount);
            FolderDetails testFolder = new FolderDetails {
                Path = _tempFolderPath
            };;
            DirectoryInfo expectedDirectory = new DirectoryInfo(_tempFolderPath);

            Assert.Equal(Directory.GetFiles(_tempFolderPath, "*.*", SearchOption.AllDirectories), testFolder.Files.Select(file => file.Path).ToArray());
        }
Beispiel #4
0
        public async Task <FolderDetails> GetDetails(int id)
        {
            var folder = await Folders
                         .FirstOrDefaultAsync(f => f.FolderId == id);

            var result = new FolderDetails();

            result.CopyFrom(folder);

            return(result);
        }
Beispiel #5
0
        private void AddFolderEntry()
        {
            var newFolderEntry = new FolderDetails
            {
                FolderId   = Guid.NewGuid(),
                FolderName = string.Empty
            };

            this.Settings.Folders.Add(newFolderEntry);

            this.SelectedFolder = newFolderEntry;
        }
Beispiel #6
0
        public async Task <IList <FolderDetails> > GetListWithDetails()
        {
            var result = await Folders
                         .Where(f => f.ParentId == 0 && f.Privacy == "public")
                         .OrderBy(f => f.FolderName)
                         .ToListAsync();

            return(result.Select(f =>
            {
                var r = new FolderDetails();
                r.CopyFrom(f);
                return r;
            }).ToList());
        }
Beispiel #7
0
        public async Task <IActionResult> Index(long?id)
        {
            FolderDetails folderViewModel = new FolderDetails();

            if (id != null)
            {
                // will give the user's userId
                var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);

                //get the particular folder(id, name, topic count) for the user by its id - DONE
                //containing the topics'(id, name + Qcard count)
                var thefolder = (await dbContext.Folders.
                                 Where(f => f.UserId == userId && f.Id == id)
                                 .Select(f => new
                {
                    f.Id,
                    f.Name,
                    f.Topics.Count
                }).ToListAsync()).FirstOrDefault();

                if (thefolder != null)
                {
                    var topicsResult = await dbContext.Topics.
                                       Where(t => t.UserId == userId && t.FolderId == id)
                                       .Select(t => new
                    {
                        t.Id,
                        t.Name,
                        t.QuestionCards.Count
                    }).ToListAsync();

                    folderViewModel.Id         = thefolder.Id;
                    folderViewModel.FolderName = thefolder.Name;

                    foreach (var topic in topicsResult)
                    {
                        folderViewModel.Topics.Add(new FolderDetails.Topic
                        {
                            Id   = (int)topic.Id,
                            Name = topic.Name,
                            QuestionCardCount = topic.Count
                        });
                    }
                }
            }

            return(View(folderViewModel));
        }
Beispiel #8
0
        public TransformationData(Markdown markdown, List <ErrorDetail> errorList, List <ImageConversion> imageDetails,
                                  List <AttachmentConversionDetail> attachNames, FolderDetails currentFolderDetails, IEnumerable <string> languagesLinksToGenerate = null, bool nonDynamicHTMLOutput = false)
        {
            NonDynamicHTMLOutput     = nonDynamicHTMLOutput;
            AttachNames              = attachNames;
            CurrentFolderDetails     = new FolderDetails(currentFolderDetails);
            ErrorList                = errorList;
            ImageDetails             = imageDetails;
            LanguagesLinksToGenerate = languagesLinksToGenerate ?? markdown.SupportedLanguages;

            HtmlBlocks          = new Dictionary <string, string>();
            FoundDoxygenSymbols = new HashSet <string>();
            Markdown            = markdown;

            processedDocumentCache = new ProcessedDocumentCache(currentFolderDetails.GetThisFileName(), this);
        }
Beispiel #9
0
        public FolderContentSnapshot CreateSnapshot(FolderDetails folder)
        {
            var snapshot = new FolderContentSnapshot();

            var existingFiles = Directory.GetFiles(folder.FolderName, "*", SearchOption.TopDirectoryOnly);

            foreach (var file in existingFiles)
            {
                var fileInfo = new FileInfo(file);
                snapshot.Files.Add(new FileDetails
                {
                    FileName   = file,
                    ChangeDate = fileInfo.LastWriteTime,
                    FolderId   = folder.FolderId
                });
            }

            snapshot.FolderId     = folder.FolderId;
            snapshot.SnapshotDate = DateTime.Now;

            return(snapshot);
        }
Beispiel #10
0
        public static string TestCase(string inputFileName, List <ErrorDetail> errorList = null)
        {
            var errors = errorList ?? new List <ErrorDetail>();

            var targetFileName  = GetTargetFileName(inputFileName);
            var sourceDirectory = Regex.Replace(Settings.Default.SourceDirectory, @"(^\.[/|\\])?[\\|/]*(.*?)[\\|/]*$", "$2");
            var outputDirectory = Regex.Replace(Settings.Default.OutputDirectory, @"(^\.[/|\\])?[\\|/]*(.*?)[\\|/]*$", "$2");

            Language.LangID = "INT";

            Language.Init(
                Path.Combine(sourceDirectory, Settings.Default.IncludeDirectory, Settings.Default.InternationalizationDirectory));

            var markdown = new Markdown();

            Markdown.MetadataErrorIfMissing = Settings.Default.MetadataErrorIfMissing.Split(',');
            Markdown.MetadataInfoIfMissing  = Settings.Default.MetadataInfoIfMissing.Split(',');
            markdown.PublishFlags           = new List <string>()
            {
                "Licensee", "Public"
            };
            markdown.AllSupportedAvailability =
                (Settings.Default.SupportedAvailability + ",Public").ToLower().Split(',').ToList();

            markdown.DoNotPublishAvailabilityFlag = "NoPublish";

            markdown.DefaultTemplate = Settings.Default.DefaultTemplate;

            markdown.ThisIsPreview = false;

            markdown.SupportedLanguages      = Settings.Default.SupportedLanguages.ToUpper().Split(',');
            markdown.SupportedLanguageLabels = Settings.Default.SupportedLanguageLabels.Split(',');
            for (int i = 0; i < markdown.SupportedLanguages.Length; i++)
            {
                markdown.SupportedLanguageMap.Add(markdown.SupportedLanguages[i], markdown.SupportedLanguageLabels[i]);
            }

            //Pass the default conversion settings to Markdown for use in the imagedetails creation.
            markdown.DefaultImageDoCompress      = Settings.Default.DoCompressImages;
            markdown.DefaultImageFormatExtension = Settings.Default.CompressImageType;
            markdown.DefaultImageFillColor       = ImageConversion.GetColorFromHexString(Settings.Default.ImageFillColor);
            markdown.DefaultImageFormat          = ImageConversion.GetImageFormat(Settings.Default.CompressImageType);
            markdown.DefaultImageQuality         = Settings.Default.ImageJPGCompressionValue;

            var imageDetails             = new List <ImageConversion>();
            var attachNames              = new List <AttachmentConversionDetail>();
            var languagesLinksToGenerate = new[] { "INT " };

            var fileOutputDirectory =
                (new DirectoryInfo(inputFileName).Parent).FullName.Replace(
                    sourceDirectory + Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture), "")
                .Replace(sourceDirectory, "");

            var currentFolderDetails = new FolderDetails(
                GetRelativeHTMLPath(targetFileName, outputDirectory),
                new DirectoryInfo(outputDirectory).FullName,
                new DirectoryInfo(sourceDirectory).FullName,
                "Temp",
                "API",
                (new DirectoryInfo(inputFileName).Parent).FullName.Replace(
                    sourceDirectory + Path.DirectorySeparatorChar.ToString(), "")
                .Replace(sourceDirectory, "")
                .Replace(Path.DirectorySeparatorChar.ToString(), " - "),
                GetLanguage(inputFileName));

            var text = File.ReadAllText(inputFileName);

            var actual = markdown.Transform(
                text, errors, imageDetails, attachNames, currentFolderDetails, languagesLinksToGenerate);

            return(actual);
        }
        static ConvertFileResponse ConvertFile(MarkdownSharp.Markdown markdownToHtml, string inputFileName, string language, IEnumerable <string> languagesLinksToGenerate, OutputFormat format = OutputFormat.HTML)
        {
            var result         = ConvertFileResponse.NoChange;
            var targetFileName = GetTargetFileName(inputFileName, language);

            //Set up parameters in Markdown to aid in processing and generating html
            Markdown.MetadataErrorIfMissing             = MetadataErrorIfMissing;
            Markdown.MetadataInfoIfMissing              = MetadataInfoIfMissing;
            markdownToHtml.DoNotPublishAvailabilityFlag = Settings.Default.DoNotPublishAvailabilityFlag;
            markdownToHtml.PublishFlags             = PublishFlags.ToList();
            markdownToHtml.AllSupportedAvailability = AllSupportedAvailability;

            var fileOutputDirectory = FileHelper.GetRelativePath(
                SourceDirectory, Path.GetDirectoryName(inputFileName));

            var currentFolderDetails = new FolderDetails(
                GetRelativeHTMLPath(targetFileName), OutputDirectory, SourceDirectory, fileOutputDirectory,
                Settings.Default.APIFolderLocation,
                (new DirectoryInfo(inputFileName).Parent).FullName.Replace(
                    SourceDirectory + Path.DirectorySeparatorChar.ToString(), "")
                .Replace(SourceDirectory, "")
                .Replace(Path.DirectorySeparatorChar.ToString(), " - "),
                language);

            markdownToHtml.DefaultTemplate = DefaultTemplate;

            markdownToHtml.ThisIsPreview = ThisIsPreview;

            if (language != "INT")
            {
                currentFolderDetails.DocumentTitle += " - " + language;
            }

            if (ThisIsPreview)
            {
                currentFolderDetails.DocumentTitle += " - PREVIEW!";
            }

            markdownToHtml.SupportedLanguages      = SupportedLanguages;
            markdownToHtml.SupportedLanguageLabels = SupportedLanguageLabels;
            for (int i = 0; i < markdownToHtml.SupportedLanguages.Length; i++)
            {
                if (!markdownToHtml.SupportedLanguageMap.ContainsKey(SupportedLanguages[i]))
                {
                    markdownToHtml.SupportedLanguageMap.Add(markdownToHtml.SupportedLanguages[i], markdownToHtml.SupportedLanguageLabels[i]);
                }
            }

            //Pass the default conversion settings to Markdown for use in the image details creation.
            markdownToHtml.DefaultImageDoCompress      = DoCompressImages;
            markdownToHtml.DefaultImageFormatExtension = CompressImageType;
            markdownToHtml.DefaultImageFillColor       = DefaultImageFillColor;
            markdownToHtml.DefaultImageFormat          = CompressImageFormat;
            markdownToHtml.DefaultImageQuality         = JpegCompressionRate;

            var errorList    = new List <ErrorDetail>();
            var imageDetails = new List <ImageConversion>();
            var attachNames  = new List <AttachmentConversionDetail>();

            var output = markdownToHtml.Transform(FileContents(inputFileName), errorList, imageDetails, attachNames, currentFolderDetails, languagesLinksToGenerate, format != OutputFormat.HTML);

            var noFailedErrorReport = true;
            var stopProcessing      = false;

            //If output empty then treat as failed, we are not converting most likely due to the publish flags and availability settings
            if (String.IsNullOrWhiteSpace(output))
            {
                noFailedErrorReport = false;
                stopProcessing      = true;
                result = ConvertFileResponse.NoChange;
                log.Info(MarkdownSharp.Language.Message("NotConverted", inputFileName));
            }
            else
            {
                //Need to check for error types prior to processing to output log messages in the correct order.
                foreach (var errorInfo in errorList)
                {
                    if (errorInfo.ClassOfMessage == MessageClass.Error || errorInfo.ClassOfMessage == MessageClass.Warning)
                    {
                        log.Info(MarkdownSharp.Language.Message("FileFailed", inputFileName));
                        noFailedErrorReport = false;
                        break;
                    }
                }
            }


            if (noFailedErrorReport)
            {
                log.Info(MarkdownSharp.Language.Message("Converted", inputFileName));
            }


            //On warnings or errors stop processing the file to the publish folder but allow to continue if in preview.
            if (errorList.Count > 0)
            {
                Console.Write("\n");


                foreach (MarkdownSharp.ErrorDetail ErrorInfo in errorList)
                {
                    switch (ErrorInfo.ClassOfMessage)
                    {
                    case MarkdownSharp.MessageClass.Error:
                        log.Error(ErrorInfo.Path ?? inputFileName, ErrorInfo.Line, ErrorInfo.Column, ErrorInfo.Message);
                        if (!ThisIsPreview)
                        {
                            stopProcessing = true;
                            result         = ConvertFileResponse.Failed;
                        }
                        break;

                    case MarkdownSharp.MessageClass.Warning:
                        log.Warn(ErrorInfo.Path ?? inputFileName, ErrorInfo.Line, ErrorInfo.Column, ErrorInfo.Message);
                        if (!ThisIsPreview)
                        {
                            stopProcessing = true;
                            result         = ConvertFileResponse.Failed;
                        }
                        break;

                    default:
                        log.Info(ErrorInfo.Path ?? inputFileName, ErrorInfo.Line, ErrorInfo.Column, ErrorInfo.Message);
                        break;
                    }
                }
            }

            if (!stopProcessing)
            {
                if (ThisIsPreview || !ThisIsLogOnly)
                {
                    CommonUnrealFunctions.CopyDocumentsImagesAndAttachments(inputFileName, log, OutputDirectory, language, fileOutputDirectory, imageDetails, attachNames);
                }

                var expected = FileContents(targetFileName);

                if (output == expected)
                {
                    result = ConvertFileResponse.NoChange;
                }
                else
                {
                    if (!stopProcessing)
                    {
                        if (!AlreadyCreatedCommonDirectories)
                        {
                            AlreadyCreatedCommonDirectories = CommonUnrealFunctions.CreateCommonDirectories(OutputDirectory, SourceDirectory, log);
                        }

                        Console.Write("\n");
                        if (ThisIsPreview || !ThisIsLogOnly)
                        {
                            //Check output directory exists, if not create the full html structure for this language
                            CommonUnrealFunctions.GenerateDocsFolderStructure(OutputDirectory, fileOutputDirectory, language);

                            CommonUnrealFunctions.SetFileAttributeForReplace(new FileInfo(targetFileName));
                            File.WriteAllText(targetFileName, output);

                            if (format == OutputFormat.PDF)
                            {
                                PdfHelper.CreatePdfFromHtml(targetFileName);
                            }
                        }

                        result = ConvertFileResponse.Converted;
                    }
                }
            }
            return(result);
        }
Beispiel #12
0
        public UDNParsingResults(string path, ITextSnapshot snapshot, MarkdownPackage package, Markdown markdown, FolderDetails folderDetails)
        {
            var log = new OutputPaneLogger();

            ParsedSnapshot = snapshot;

            // Use the Publish Flag combo box to set the markdown details.
            markdown.PublishFlags.Clear();

            // Always include public
            markdown.PublishFlags.Add(Settings.Default.PublicAvailabilitiesString);

            foreach (var flagName in package.PublishFlags)
            {
                markdown.PublishFlags.Add(flagName);
            }

            Errors      = new List <ErrorDetail>();
            Images      = new List <ImageConversion>();
            Attachments = new List <AttachmentConversionDetail>();

            Document = markdown.ParseDocument(ParsedSnapshot.GetText(), Errors, Images, Attachments, folderDetails);

            DoxygenHelper.SetTrackedSymbols(Document.TransformationData.FoundDoxygenSymbols);

            CommonUnrealFunctions.CopyDocumentsImagesAndAttachments(
                path, log, folderDetails.AbsoluteHTMLPath, folderDetails.Language,
                folderDetails.CurrentFolderFromMarkdownAsTopLeaf, Images, Attachments);

            // Create common directories like css includes top level images etc.
            // Needs to be created everytime the document is generated to allow
            // changes to these files to show in the preview window without
            // restarting VS.
            CommonUnrealFunctions.CreateCommonDirectories(
                folderDetails.AbsoluteHTMLPath, folderDetails.AbsoluteMarkdownPath, log);
        }
Beispiel #13
0
        //Setup defaults and file values for this documents markdown transform
        private void markdownTransformSetup(string FileName, Markdown markdownTransform, FolderDetails CurrentFolderDetails)
        {
            DirectoryInfo SourceDirectoryInfo = new DirectoryInfo(FileName).Parent;

            //Source directory path is found using the SourceDirectoryName setting and the file
            while (SourceDirectoryInfo != null && SourceDirectoryInfo.Name != Settings.Default.SourceDirectoryName)
            {
                SourceDirectoryInfo = SourceDirectoryInfo.Parent;
            }

            if (SourceDirectoryInfo != null)
            {
                string SourceDirectory = SourceDirectoryInfo.FullName;

                string OutputDirectory = Path.Combine(Path.GetTempPath(), "UDTMarkdownMode") + "/";


                string FileOutputDirectory = (new DirectoryInfo(FileName).Parent).FullName.Replace(SourceDirectory + Path.DirectorySeparatorChar, "").Replace(SourceDirectory, "");

                CurrentFolderDetails.RelativeHTMLPath     = OutputDirectory.Replace(@"C:\", @"file://127.0.0.1/c$/");
                CurrentFolderDetails.AbsoluteHTMLPath     = OutputDirectory;
                CurrentFolderDetails.AbsoluteMarkdownPath = SourceDirectory;
                CurrentFolderDetails.CurrentFolderFromMarkdownAsTopLeaf = FileOutputDirectory;
                CurrentFolderDetails.DocumentTitle = (new DirectoryInfo(FileName).Parent).FullName.Replace(SourceDirectory + Path.DirectorySeparatorChar.ToString(), "").Replace(SourceDirectory, "").Replace(Path.DirectorySeparatorChar.ToString(), " - ");
                CurrentFolderDetails.Language      = Regex.Replace(Path.GetFileNameWithoutExtension(FileName).ToUpper(), @"[^\.]*?\.(.*$)", "$1");
                CurrentFolderDetails.APIFolderLocationFromMarkdownAsTop = Settings.Default.APIFolderLocation;

                Language.Init(Path.Combine(CurrentFolderDetails.AbsoluteMarkdownPath, "Include", "Internationalization"));

                DoxygenHelper.DoxygenInputFilter =
                    new FileInfo(
                        Path.Combine(
                            CurrentFolderDetails.AbsoluteMarkdownPath,
                            "..",
                            "..",
                            "Binaries",
                            "DotNET",
                            "UnrealDocToolDoxygenInputFilter.exe")).FullName;

                if (CurrentFolderDetails.Language != "INT")
                {
                    CurrentFolderDetails.DocumentTitle += " - " + CurrentFolderDetails.Language;
                }
                CurrentFolderDetails.DocumentTitle += " - " + Language.Message("Preview");

                Markdown.MetadataErrorIfMissing = Settings.MetadataErrorIfMissing;
                Markdown.MetadataInfoIfMissing  = Settings.MetadataInfoIfMissing;

                markdownTransform.DefaultTemplate = Settings.Default.DefaultTemplate;

                markdownTransform.ThisIsPreview = true;

                markdownTransform.SupportedLanguages      = Settings.SupportedLanguages;
                markdownTransform.SupportedLanguageLabels = Settings.SupportedLanguageLabels;
                for (int i = 0; i < markdownTransform.SupportedLanguages.Length; i++)
                {
                    if (!markdownTransform.SupportedLanguageMap.ContainsKey(markdownTransform.SupportedLanguages[i]))
                    {
                        markdownTransform.SupportedLanguageMap.Add(markdownTransform.SupportedLanguages[i], markdownTransform.SupportedLanguageLabels[i]);
                    }
                }

                markdownTransform.AllSupportedAvailability = new List <string>();
                foreach (string Availablity in Settings.SupportedAvailabilities)
                {
                    markdownTransform.AllSupportedAvailability.Add(Availablity);
                }
                //Add public into list
                markdownTransform.AllSupportedAvailability.Add(Settings.Default.PublicAvailabilitiesString);

                markdownTransform.PublishFlags = new List <string>();
                markdownTransform.DoNotPublishAvailabilityFlag = Settings.Default.DoNotPublishAvailabilitiesFlag.ToLower();

                //Pass the default conversion settings to Markdown for use in the imagedetails creation.
                markdownTransform.DefaultImageDoCompress      = Settings.Default.DoCompressImages;
                markdownTransform.DefaultImageFormatExtension = Settings.Default.CompressImageType;
                markdownTransform.DefaultImageFillColor       = Settings.DefaultImageFillColor;
                markdownTransform.DefaultImageFormat          = ImageConversion.GetImageFormat(Settings.Default.CompressImageType);
                markdownTransform.DefaultImageQuality         = Settings.Default.JpegCompressionRate;
            }
        }
Beispiel #14
0
        public static SuperEventDetails CreateObject(PayLoad payLoad)
        {
            SuperEventDetails superEventDetail = new SuperEventDetails();

            foreach (Event _event in payLoad.Data)
            {
                if (_event.AdditionalDetails == null)
                {
                    _event.AdditionalDetails = new AdditionalDetails();
                }

                List <EventDetailHeader> gett = new List <EventDetailHeader>();

                var eventDetailHeader = new EventDetailHeader()
                {
                    EventID            = _event.EventID,
                    NextStreamPosition = payLoad.NextStreamPosition,
                    EventTimeStamp     = _event.EventTimestamp
                };

                superEventDetail.EventDetailHeaders.Add(eventDetailHeader);

                switch (_event.ObjectType)
                {
                case "SHEET":
                    var sheetDetail = new SheetDetails()
                    {
                        EventID                = _event.EventID,
                        ObjectID               = _event.ObjectID,
                        Action                 = _event.Action,
                        SourceObjectID         = _event.AdditionalDetails.SourceObjectID,
                        SourceGlobaltemplateID = _event.AdditionalDetails.SourceGlobalTemplateID,
                        SourcetemplateID       = _event.AdditionalDetails.SourceTemplateID,
                        Source                 = _event.AdditionalDetails.Source,
                        SourceType             = _event.AdditionalDetails.SourceType,
                        SheetName              = _event.AdditionalDetails.SheetName,
                        NewName                = _event.AdditionalDetails.NewName,
                        OldName                = _event.AdditionalDetails.OldName,
                        AccessLevel            = _event.AdditionalDetails.AccessLevel,
                        UserIDInitiator        = _event.AdditionalDetails.UserID,

                        GroupID               = _event.AdditionalDetails.GroupID,
                        WorkSpaceID           = _event.AdditionalDetails.WorkSpaceID,
                        OldUserID             = _event.AdditionalDetails.OldUserID,
                        OldAccessLevel        = _event.AdditionalDetails.OldAccessLevel,
                        NewUserID             = _event.AdditionalDetails.NewUserID,
                        NewAccessLevel        = _event.AdditionalDetails.NewAccessLevel,
                        RecipientEmail        = _event.AdditionalDetails.RecipientEmail,
                        RecipientGroupID      = _event.AdditionalDetails.RecipientGroupID,
                        FormatType            = _event.AdditionalDetails.FormatType,
                        RowCount              = _event.AdditionalDetails.RowCount,
                        IncludeAttachments    = _event.AdditionalDetails.IncludeAttachments,
                        IncludeDiscussions    = _event.AdditionalDetails.IncludeDiscussions,
                        SourceSheetID         = _event.AdditionalDetails.SourceSheetID,
                        DestinationSheetID    = _event.AdditionalDetails.DestinationSheetID,
                        RowsMoved             = _event.AdditionalDetails.RowsMoved,
                        RowsCopied            = _event.AdditionalDetails.RowsCopied,
                        CelllinkSourceSheetID = _event.AdditionalDetails.CelllinkSourceSheetID,
                        NewParentContainerID  = _event.AdditionalDetails.NewParentContainerID,
                        ParentContainerID     = _event.AdditionalDetails.ParentContainerID,
                        FolderName            = _event.AdditionalDetails.FolderName,
                        RequestUserID         = _event.AdditionalDetails.RequestUserID,
                        SendCompletionEmail   = _event.AdditionalDetails.SendCompletionEmail,
                        UserIDImpacted        = _event.AdditionalDetails.UserIDImpacted,
                        EventTimestamp        = _event.AdditionalDetails.EventTimeStamp
                    };
                    superEventDetail.SheetDetails.Add(sheetDetail);
                    break;

                case "REPORT":
                    var reportDetail = new ReportDetails()
                    {
                        EventID  = _event.EventID,
                        ObjectID = _event.ObjectID,
                        Action   = _event.Action,

                        ReportName             = _event.AdditionalDetails.ReportName,
                        SourceObjectID         = _event.AdditionalDetails.SourceObjectID,
                        SourceGlobaltemplateID = _event.AdditionalDetails.SourceGlobalTemplateID,
                        SourceType             = _event.AdditionalDetails.SourceType,
                        NewName              = _event.AdditionalDetails.NewName,
                        OldName              = _event.AdditionalDetails.OldName,
                        AccessLevel          = _event.AdditionalDetails.AccessLevel,
                        UserID               = _event.AdditionalDetails.UserID,
                        GroupID              = _event.AdditionalDetails.GroupID,
                        WorkSpaceID          = _event.AdditionalDetails.WorkSpaceID,
                        OldUserID            = _event.AdditionalDetails.OldUserID,
                        OldAccessLevel       = _event.AdditionalDetails.OldAccessLevel,
                        NewUserID            = _event.AdditionalDetails.NewUserID,
                        NewAccessLevel       = _event.AdditionalDetails.NewAccessLevel,
                        NewParentContainerID = _event.AdditionalDetails.NewParentContainerID,
                        ParentContainerID    = _event.AdditionalDetails.ParentContainerID,
                        FolderName           = _event.AdditionalDetails.FolderName,
                        RecipientEmail       = _event.AdditionalDetails.RecipientEmail,
                        RecipientGroupID     = _event.AdditionalDetails.RecipientGroupID,
                        FormatType           = _event.AdditionalDetails.FormatType,
                        UserIDImpacted       = _event.AdditionalDetails.UserIDImpacted,
                        UserIDInitiator      = _event.UserID,
                        EventTimestamp       = _event.EventTimestamp,
                        RequestUserID        = _event.RequestUserID,
                        Source               = _event.Source
                    };

                    superEventDetail.ReportDetails.Add(reportDetail);
                    break;

                case "ATTACHMENT":
                    var attachmentDetail = new AttachmentDetails()
                    {
                        EventID               = _event.EventID,
                        ObjectID              = _event.ObjectID,
                        Action                = _event.Action,
                        SheetID               = _event.AdditionalDetails.SheetID,
                        WorkSpaceID           = _event.AdditionalDetails.WorkSpaceID,
                        AttachmentName        = _event.AdditionalDetails.AttachmentName,
                        MultifileDownloadname = _event.AdditionalDetails.MultifileDownloadName,
                        RecipientEmail        = _event.AdditionalDetails.RecipientEmail,
                        RecipientGroupID      = _event.AdditionalDetails.RecipientGroupID,
                        UserIDInitiator       = _event.UserID,
                        EventTimestamp        = _event.EventTimestamp,
                        RequestUserID         = _event.RequestUserID,
                        Source                = _event.Source,
                    };
                    superEventDetail.AttachmentDetails.Add(attachmentDetail);
                    break;

                case "USER":
                    var userDetail = new UserDetails()
                    {
                        EventID         = _event.EventID,
                        ObjectID        = _event.ObjectID,
                        Action          = _event.Action,
                        UserTypes       = _event.AdditionalDetails.UserTypes,
                        EmailAddress    = _event.AdditionalDetails.EmailAddress,
                        DeclineReason   = _event.AdditionalDetails.DeclineReason,
                        OldownerUserID  = _event.AdditionalDetails.OldOwnerUserID,
                        NewownerUserID  = _event.AdditionalDetails.NewOwnerUserID,
                        UserIDInitiator = _event.UserID,
                        EventTimestamp  = _event.EventTimestamp,
                        RequestUserID   = _event.RequestUserID,
                        Source          = _event.Source,
                    };
                    superEventDetail.UserDetails.Add(userDetail);
                    break;

                case "DISCUSSION":
                    var discussionDetail = new DiscussionDetails()
                    {
                        EventID            = _event.EventID,
                        ObjectID           = _event.ObjectID,
                        Action             = _event.Action,
                        SheetRowID         = _event.AdditionalDetails.SheetRowID,
                        SheetID            = _event.AdditionalDetails.SheetID,
                        WorkSpaceID        = _event.AdditionalDetails.WorkSpaceID,
                        RecipientEmail     = _event.AdditionalDetails.RecipientEmail,
                        RecipientGroupID   = _event.AdditionalDetails.RecipientGroupID,
                        IncludeAttachments = _event.AdditionalDetails.IncludeAttachments,
                        UserIDInitiator    = _event.UserID,
                        EventTimestamp     = _event.EventTimestamp,
                        RequestUserID      = _event.RequestUserID,
                        Source             = _event.Source,
                    };
                    superEventDetail.DiscussionDetails.Add(discussionDetail);
                    break;

                case "DASHBOARD":
                    var dashboardDetail = new DashboardDetails()
                    {
                        EventID                = _event.EventID,
                        ObjectID               = _event.ObjectID,
                        Action                 = _event.Action,
                        DashboardName          = _event.AdditionalDetails.DashboardName,
                        SourceGlobalTemplateID = _event.AdditionalDetails.SourceGlobalTemplateID,
                        SourceObjectID         = _event.AdditionalDetails.SourceObjectID,
                        SourceType             = _event.AdditionalDetails.SourceType,
                        AccessibleBy           = _event.AdditionalDetails.AccessibleBy,
                        PublishType            = _event.AdditionalDetails.PublishType,
                        PublishFormat          = _event.AdditionalDetails.PublishFormat,
                        AccessLevel            = _event.AdditionalDetails.AccessLevel,
                        UserID                 = _event.AdditionalDetails.UserID,
                        GroupID                = _event.AdditionalDetails.GroupID,
                        WorkspaceID            = _event.AdditionalDetails.WorkSpaceID,
                        OldUserID              = _event.AdditionalDetails.OldUserID,
                        OldAccessLevel         = _event.AdditionalDetails.OldAccessLevel,
                        NewUserID              = _event.AdditionalDetails.NewUserID,
                        NewAccessLevel         = _event.AdditionalDetails.NewAccessLevel,
                        NewparentContainerID   = _event.AdditionalDetails.NewParentContainerID,
                        ParentContainerID      = _event.AdditionalDetails.ParentContainerID,
                        FolderName             = _event.AdditionalDetails.FolderName,
                        OldName                = _event.AdditionalDetails.OldName,
                        NewName                = _event.AdditionalDetails.NewName,
                        UserIDInitiator        = _event.UserID,
                        EventTimestamp         = _event.EventTimestamp,
                        RequestUserID          = _event.RequestUserID,
                        Source                 = _event.Source,
                    };
                    superEventDetail.DashboardDetails.Add(dashboardDetail);
                    break;

                case "FOLDER":
                    var folderDetail = new FolderDetails()
                    {
                        EventID             = _event.EventID,
                        ObjectID            = _event.ObjectID,
                        Action              = _event.Action,
                        FolderName          = _event.AdditionalDetails.FolderName,
                        SourceFolderID      = _event.AdditionalDetails.SourceFolderID,
                        OldName             = _event.AdditionalDetails.OldName,
                        NewName             = _event.AdditionalDetails.NewName,
                        SendCompletionEmail = _event.AdditionalDetails.SendCompletionEmail,
                        IncludeAttachments  = _event.AdditionalDetails.IncludeAttachments,
                        FormatType          = _event.AdditionalDetails.FormatType,
                        UserIDInitiator     = _event.UserID,
                        EventTimestamp      = _event.EventTimestamp,
                        RequestUserID       = _event.RequestUserID,
                        Source              = _event.Source,
                    };
                    superEventDetail.FolderDetails.Add(folderDetail);
                    break;

                case "FORM":
                    var formDetail = new FormDetails()
                    {
                        EventID         = _event.EventID,
                        ObjectID        = _event.ObjectID,
                        Action          = _event.Action,
                        FormName        = _event.AdditionalDetails.FolderName,
                        SheetID         = _event.AdditionalDetails.SheetID,
                        UserIDInitiator = _event.UserID,
                        EventTimestamp  = _event.EventTimestamp,
                        RequestUserID   = _event.RequestUserID,
                        Source          = _event.Source,
                    };
                    superEventDetail.FormDetails.Add(formDetail);
                    break;

                case "UPDATE REQUEST":
                    var updateRequestDetail = new UpdateRequestDetails()
                    {
                        EventID            = _event.EventID,
                        ObjectID           = _event.ObjectID,
                        Action             = _event.Action,
                        SheetID            = _event.AdditionalDetails.SheetID,
                        RowCounts          = _event.AdditionalDetails.RowCount.ToString(),
                        IncludeAttachments = _event.AdditionalDetails.IncludeAttachments,
                        IncludeDiscussions = _event.AdditionalDetails.IncludeDiscussions,
                        UserIDInitiator    = _event.UserID,
                        EventTimestamp     = _event.EventTimestamp,
                        RequestUserID      = _event.RequestUserID,
                        Source             = _event.Source,
                    };
                    superEventDetail.UpdateRequestDetails.Add(updateRequestDetail);
                    break;

                case "WORKSPACE":
                    var workspaceDetail = new WorkSpaceDetails()
                    {
                        EventID             = _event.EventID,
                        ObjectID            = _event.ObjectID,
                        Action              = _event.Action,
                        OldName             = _event.AdditionalDetails.OldName,
                        NewName             = _event.AdditionalDetails.NewName,
                        AccessLevel         = _event.AdditionalDetails.AccessLevel,
                        UserID              = _event.AdditionalDetails.UserID,
                        GroupID             = _event.AdditionalDetails.GroupID,
                        IncludeAttachments  = _event.AdditionalDetails.IncludeAttachments,
                        SendCompletionEmail = _event.AdditionalDetails.SendCompletionEmail,
                        FormatType          = _event.AdditionalDetails.FormatType,
                        UserIDInitiator     = _event.UserID,
                        EventTimestamp      = _event.EventTimestamp,
                        RequestUserID       = _event.RequestUserID,
                        Source              = _event.Source,
                    };
                    superEventDetail.WorkSpaceDetails.Add(workspaceDetail);
                    break;

                case "ACCESSTOKEN":
                    var accessTokenDetails = new AccessTokenDetails()
                    {
                        EventID                  = _event.EventID,
                        ObjectID                 = _event.ObjectID,
                        Action                   = _event.Action,
                        TokenName                = _event.AdditionalDetails.TokenName,
                        TokenDisplayValue        = _event.AdditionalDetails.TokenDisplayValue,
                        TokenExpirationTimestamp = _event.AdditionalDetails.TokenExpirationTimestamp,
                        AccessScopes             = _event.AdditionalDetails.AccessScopes,
                        AppClientID              = _event.AdditionalDetails.AppClientID,
                        AppName                  = _event.AdditionalDetails.AppName,
                        TokenUserID              = _event.AdditionalDetails.TokenUserID,
                        UserIDInitiator          = _event.UserID,
                        EventTimestamp           = _event.EventTimestamp,
                        RequestUserID            = _event.RequestUserID,
                        Source                   = _event.Source,
                    };
                    superEventDetail.AccessTokenDetails.Add(accessTokenDetails);
                    break;

                case "ACCOUNT":
                    var accountDetails = new AccountDetails()
                    {
                        EventID          = _event.EventID,
                        ObjectID         = _event.ObjectID,
                        Action           = _event.Action,
                        NewContactUserID = _event.AdditionalDetails.NewContactUserID,
                        OldContactUserID = _event.AdditionalDetails.OldContactUserID,
                        NewName          = _event.AdditionalDetails.NewName,
                        OldName          = _event.AdditionalDetails.OldName,
                        UserIDInitiator  = _event.UserID,
                        EventTimestamp   = _event.EventTimestamp,
                        RequestUserID    = _event.RequestUserID,
                        Source           = _event.Source,
                    };
                    superEventDetail.AccountDetails.Add(accountDetails);
                    break;

                case "GROUP":
                    var groupDetails = new GroupDetails()
                    {
                        EventID         = _event.EventID,
                        ObjectID        = _event.ObjectID,
                        Action          = _event.Action,
                        GroupName       = _event.AdditionalDetails.GroupName,
                        OldName         = _event.AdditionalDetails.OldName,
                        NewName         = _event.AdditionalDetails.NewName,
                        OldownerUserID  = _event.AdditionalDetails.OldOwnerUserID,
                        NewownerUserID  = _event.AdditionalDetails.NewOwnerUserID,
                        MemberUserID    = _event.AdditionalDetails.MemberUserID,
                        UserIDInitiator = _event.UserID,
                        EventTimestamp  = _event.EventTimestamp,
                        RequestUserID   = _event.RequestUserID,
                        Source          = _event.Source,
                    };
                    superEventDetail.GroupDetails.Add(groupDetails);
                    break;
                }
            }
            return(superEventDetail);
        }