Example #1
0
        // Note: Method name has been picked in analogy to method names in AclExpansionHtmlWriter.
        private void WriteTableBody_ProcessUser(User user, List <AclExpansionEntry> aclExpansion)
        {
            _implementation.WriteTableData(user.UserName);
            _implementation.WriteTableData(user.FirstName);
            _implementation.WriteTableData(user.LastName);

            string userDetailFileName = AclExpansionHtmlWriterImplementationBase.ToValidFileName(user.UserName);

            using (var detailTextWriter = _textWriterFactory.CreateTextWriter(userDetailFileName))
            {
                var aclExpansionSingleUser       = GetAccessControlEntriesForUser(aclExpansion, user);
                var detailAclExpansionHtmlWriter = new AclExpansionHtmlWriter(detailTextWriter, false, _detailHtmlWriterSettings);
                detailAclExpansionHtmlWriter.WriteAclExpansion(aclExpansionSingleUser);
            }

            string relativePath = _textWriterFactory.GetRelativePath(MasterFileName, userDetailFileName);

            _implementation.WriteTableRowBeginIfNotInTableRow();
            _implementation.HtmlTagWriter.Tags.td();
            _implementation.HtmlTagWriter.Tags.a();
            _implementation.HtmlTagWriter.Attribute("href", relativePath);
            _implementation.HtmlTagWriter.Attribute("target", "_blank");
            _implementation.HtmlTagWriter.Value(relativePath);
            _implementation.HtmlTagWriter.Tags.aEnd();
            _implementation.HtmlTagWriter.Tags.tdEnd();
        }
Example #2
0
        private void WriteAclExpansionAsSingleFileHtml(List <AclExpansionEntry> aclExpansion)
        {
            _textWriterFactory.Extension = "html";
            string directoryUsed = Settings.Directory;

            _textWriterFactory.Directory = directoryUsed;
            using (var textWriter = _textWriterFactory.CreateTextWriter("AclExpansion_" + StringUtility.GetFileNameTimestampNow()))
            {
                var aclExpansionHtmlWriter = new AclExpansionHtmlWriter(textWriter, true, CreateAclExpansionHtmlWriterSettings());
                aclExpansionHtmlWriter.WriteAclExpansion(aclExpansion);
            }
            WriteCssFile();
        }