Example #1
0
        public NewTopicForm(HelpComponents helpComponents)
        {
            InitializeComponent();

            _helpComponents = helpComponents;
            _preprocessedTopic = null;
        }
Example #2
0
        public NewTopicForm(HelpComponents helpComponents)
        {
            InitializeComponent();

            _helpComponents    = helpComponents;
            _preprocessedTopic = null;
        }
Example #3
0
        public string CompileForHtml(Form form, string text, HelpComponents helpComponents,
                                     TopicCompilerSettingsInterface topicCompilerSettings)
        {
            TopicCompiler topicCompiler = new TopicCompiler(form, helpComponents, _preprocessedTopic, topicCompilerSettings);

            return(topicCompiler.CompileForHtml(text));
        }
Example #4
0
        public string CompileForHtml(CSPro.Logic.Colorizer colorizer, string text,
                                     HelpComponents helpComponents, TopicCompilerSettingsInterface topicCompilerSettings)
        {
            TopicCompiler topicCompiler = new TopicCompiler(colorizer, helpComponents, _preprocessedTopic, topicCompilerSettings);

            return(topicCompiler.CompileForHtml(text));
        }
        public FilteredTopicsViewerForm(HelpComponents helpComponents)
        {
            InitializeComponent();

            _helpComponents        = helpComponents;
            _initialWindowTitle    = this.Text;
            _topicCompilerSettings = new TextEditFormTopicCompilerSettings();
        }
Example #6
0
        public TopicCompiler(CSPro.Logic.Colorizer colorizer, HelpComponents helpComponents,
                             Preprocessor.TopicPreprocessor preprocessedTopic, TopicCompilerSettingsInterface topicCompilerSettings)
        {
            _helpComponents        = helpComponents;
            _preprocessedTopic     = preprocessedTopic;
            _topicCompilerSettings = topicCompilerSettings;

            _colorizer = colorizer;
            _colorizer.SetLinkFormatter(GetHtmlFilenameForKeyword);

            _sb = new StringBuilder();

            _tagSettings = new Dictionary <string, TagSettings>();
            _tagSettings.Add(TagTitle, new TagSettings(true, (StartTagHandlerDelegate)StartTitleHandler, (EndTagHandlerDelegate)EndTitleHandler, 0, 1));
            _tagSettings.Add(ContextTag, new TagSettings(false, (StartTagHandlerDelegate)StartContextHandler, null, 1, Int32.MaxValue));
            _tagSettings.Add(IndentTag, new TagSettings(true, (StartTagHandlerDelegate)StartIndentHandler, (EndTagHandlerDelegate)EndTagHandlerUsingFilledEndTagStack, 0, 1));
            _tagSettings.Add(CenterTag, new TagSettings("<div align=\"center\">", "</div>"));
            _tagSettings.Add(BoldTag, new TagSettings("<b>", "</b>"));
            _tagSettings.Add(ItalicsTag, new TagSettings("<i>", "</i>"));
            _tagSettings.Add(SuperscriptTag, new TagSettings("<sup>", "</sup>"));
            _tagSettings.Add(FontTag, new TagSettings(true, (StartTagHandlerDelegate)StartFontHandler, "</span>", 1, 3));
            _tagSettings.Add(ListTag, new TagSettings(true, (StartTagHandlerDelegate)StartListHandler, (EndTagHandlerDelegate)EndTagHandlerUsingFilledEndTagStack, 0, 1));
            _tagSettings.Add(ListItemTag, new TagSettings("<li>", "</li>"));
            _tagSettings.Add(HeaderTag, new TagSettings("<div class=\"header_size header\">", "</div>"));
            _tagSettings.Add(SubheaderTag, new TagSettings("<div class=\"subheader_size subheader\">", "</div>"));
            _tagSettings.Add(ImageTag, new TagSettings(false, (StartTagHandlerDelegate)StartImageHandler, null, 1, 2));
            _tagSettings.Add(TopicTag, new TagSettings(false, (StartTagHandlerDelegate)StartTopicHandler, null, 1, 1));
            _tagSettings.Add(LinkTag, new TagSettings(true, (StartTagHandlerDelegate)StartLinkHandler, "</a>", 1, 1));
            _tagSettings.Add(TableTag, new TagSettings(true, (StartTagHandlerDelegate)StartTableHandler, (EndTagHandlerDelegate)EndTableHandler, 1, 4));
            _tagSettings.Add(TableCellTag, new TagSettings(true, (StartTagHandlerDelegate)StartTableCellHandler, (EndTagHandlerDelegate)EndTableCellHandler, 0, 2));
            _tagSettings.Add(SeeAlsoTag, new TagSettings(false, (StartTagHandlerDelegate)StartSeeAlsoHandler, null, 1, Int32.MaxValue));
            _tagSettings.Add(LogicTag, new TagSettings(true, "", (EndTagHandlerDelegate)EndLogicHandler, 0, 0));
            _tagSettings.Add(LogicSyntaxTag, new TagSettings(true, (StartTagHandlerDelegate)StartLogicObjectHandler, (EndTagHandlerDelegate)EndLogicSyntaxHandler, 0, 1));
            _tagSettings.Add(LogicColorTag, new TagSettings(true, (StartTagHandlerDelegate)StartLogicObjectHandler, (EndTagHandlerDelegate)EndLogicColorHandler, 0, 1));
            _tagSettings.Add(LogicArgumentTag, new TagSettings("<span class=\"code_colorization_argument\">", "</span>"));
            _tagSettings.Add(LogicTableTag, new TagSettings(false, (StartTagHandlerDelegate)StartLogicTableHandler, null, 1, 1));
            _tagSettings.Add(MessageTag, new TagSettings(true, "", (EndTagHandlerDelegate)EndMessageHandler, 0, 0));
            _tagSettings.Add(ReportTag, new TagSettings(true, (StartTagHandlerDelegate)StartReportHandler, (EndTagHandlerDelegate)EndReportHandler, 0, 1));
            _tagSettings.Add(PffTag, new TagSettings(true, "", (EndTagHandlerDelegate)EndPffHandler, 0, 0));
            _tagSettings.Add(PffColorTag, new TagSettings(true, "", (EndTagHandlerDelegate)EndPffColorHandler, 0, 0));
            _tagSettings.Add(ColorTag, new TagSettings(true, (StartTagHandlerDelegate)StartColorHandler, (EndTagHandlerDelegate)EndColorHandler, 1, 1));
            _tagSettings.Add(ColorInlineTag, new TagSettings(true, (StartTagHandlerDelegate)StartColorHandler, (EndTagHandlerDelegate)EndColorInlineHandler, 1, 1));
            _tagSettings.Add(HtmlTag, new TagSettings("", ""));
            _tagSettings.Add(CalloutTag, new TagSettings(true, "<div style=\"background-color: lightgrey;border:1px solid black;margin:10px;padding:10px\">", "</div>", 0, 0));
            _tagSettings.Add(PageBreakTag, new TagSettings(false, "<div class=\"new-page\" />", "", 0, 0));

            _blockTags = new HashSet <string>();
            _blockTags.Add(LogicTag);
            _blockTags.Add(LogicSyntaxTag);
            _blockTags.Add(MessageTag);
            _blockTags.Add(ReportTag);
            _blockTags.Add(PffTag);
            _blockTags.Add(ColorTag);
            _blockTags.Add(HtmlTag);
        }
        public GenerateHelpsForm(HelpComponents helpComponents, GenerationType generationType)
        {
            InitializeComponent();

            _helpComponents = helpComponents;
            _generationType = generationType;

            _colorizer = new CSPro.Logic.Colorizer(Handle.ToInt32());

            _projectName = new DirectoryInfo(_helpComponents.projectPath).Name;

            string outputPath = Path.GetFullPath(Path.Combine(_helpComponents.projectPath, "..", Constants.OutputsDirectoryName));

            _temporaryFilesPath = Path.Combine(_helpComponents.projectPath, Constants.TemporaryFileDirectoryName);
            Directory.CreateDirectory(_temporaryFilesPath);

            _backgroundThread = new BackgroundWorker();

            // for the CHM
            string outputChmPath = Path.Combine(outputPath, Constants.OutputsChmDirectoryName);

            Directory.CreateDirectory(outputChmPath);

            _outputChmFilename = Path.Combine(outputChmPath, _projectName + Constants.ChmFileExtension);
            File.Delete(_outputChmFilename);

            _outputTopicFilenames     = new Dictionary <Preprocessor.TopicPreprocessor, string>();
            _chmTopicCompilerSettings = new GenerateChmTopicCompilerSettings();

            // for the website
            _outputWebsitePath = Path.Combine(outputPath, Constants.OutputsWebsiteDirectoryName, _projectName);

            if (Directory.Exists(_outputWebsitePath))
            {
                Directory.Delete(_outputWebsitePath, true);
            }

            Directory.CreateDirectory(_outputWebsitePath);

            _websiteTopicCompilerSettings = new GenerateWebsiteTopicCompilerSettings(_helpComponents);

            // for the PDF
            string outputPdfPath = Path.Combine(outputPath, Constants.OutputsPdfDirectoryName);

            Directory.CreateDirectory(outputPdfPath);

            _outputPdfFilename = Path.Combine(outputPdfPath, _projectName + ".pdf");
            File.Delete(_outputPdfFilename);

            _outputPdfTopicsFilename = Path.Combine(_temporaryFilesPath, "_output_pdf_topics.html");

            _pdfTopicCompilerSettings = new GeneratePdfTopicCompilerSettings();
        }
        public GenerateHelpsForm(HelpComponents helpComponents,bool generateAndClose)
        {
            InitializeComponent();

            _helpComponents = helpComponents;
            _generateAndClose = generateAndClose;

            _projectName = new DirectoryInfo(_helpComponents.projectPath).Name;
            _outputChmFilename = Path.Combine(_helpComponents.projectPath,_projectName + Constants.ChmFileExtension);
            _temporaryFilesPath = Path.Combine(_helpComponents.projectPath,Constants.TemporaryFileDirectoryName);

            _outputTopicFilenames = new Dictionary<Preprocessor.TopicPreprocessor,string>();
            _topicCompilerSettings = new GenerateHelpsFormTopicCompilerSettings();

            _backgroundThread = new BackgroundWorker();
        }
Example #9
0
        public TextEditForm(TextEditableInterface textEditableInterface,HelpComponents helpComponents)
        {
            InitializeComponent();

            _textEditableInterface = textEditableInterface;
            _helpComponents = helpComponents;
            _filename = textEditableInterface.Filename;

            _modified = false;
            _baseWindowTitle = this.Text;
            UpdateWindowTitle();

            editControl.SetTextModifiedHandler(this);

            linkLabelFilename.Text = _filename;

            if( _textEditableInterface is Topic )
                _topicCompilerSettings = new TextEditFormTopicCompilerSettings();

            LoadFile();
        }
Example #10
0
        public TextEditForm(TextEditableInterface textEditableInterface, HelpComponents helpComponents)
        {
            InitializeComponent();

            _textEditableInterface = textEditableInterface;
            _helpComponents        = helpComponents;
            _filename = textEditableInterface.Filename;

            _modified        = false;
            _baseWindowTitle = this.Text;
            UpdateWindowTitle();

            editControl.SetTextModifiedHandler(this);

            linkLabelFilename.Text = _filename;

            if (_textEditableInterface is Topic)
            {
                _topicCompilerSettings = new TextEditFormTopicCompilerSettings();
            }

            LoadFile();
        }
Example #11
0
        public TopicCompiler(HelpComponents helpComponents,Preprocessor.TopicPreprocessor preprocessedTopic,TopicCompilerSettingsInterface topicCompilerSettings)
        {
            _helpComponents = helpComponents;
            _preprocessedTopic = preprocessedTopic;
            _topicCompilerSettings = topicCompilerSettings;
            _sb = new StringBuilder();

            _tagSettings = new Dictionary<string,TagSettings>();
            _tagSettings.Add(TagTitle,new TagSettings(true,null,(EndTagHandlerDelegate)EndTitleHandler,0,0));
            _tagSettings.Add(ContextTag,new TagSettings(false,(StartTagHandlerDelegate)StartContextHandler,null,1,Int32.MaxValue));
            _tagSettings.Add(IndentTag,new TagSettings(true,(StartTagHandlerDelegate)StartIndentHandler,(EndTagHandlerDelegate)EndTagHandlerUsingFilledEndTagStack,0,1));
            _tagSettings.Add(CenterTag,new TagSettings("<div align=\"center\">","</div>"));
            _tagSettings.Add(BoldTag,new TagSettings("<b>","</b>"));
            _tagSettings.Add(ItalicsTag,new TagSettings("<i>","</i>"));
            _tagSettings.Add(FontTag,new TagSettings(true,(StartTagHandlerDelegate)StartFontHandler,"</span>",1,3));
            _tagSettings.Add(ListTag,new TagSettings(true,(StartTagHandlerDelegate)StartListHandler,(EndTagHandlerDelegate)EndTagHandlerUsingFilledEndTagStack,0,1));
            _tagSettings.Add(ListItemTag,new TagSettings("<li>","</li>"));
            _tagSettings.Add(HeaderTag,new TagSettings("<div class=\"header_size header\">","</div>"));
            _tagSettings.Add(TitleHeaderTag,new TagSettings(false,(StartTagHandlerDelegate)StartTitleHeaderHandler,null,0,0));
            _tagSettings.Add(SubheaderTag,new TagSettings("<div class=\"subheader_size subheader\">","</div>"));
            _tagSettings.Add(ImageTag,new TagSettings(false,(StartTagHandlerDelegate)StartImageHandler,null,1,2));
            _tagSettings.Add(TopicTag,new TagSettings(false,(StartTagHandlerDelegate)StartTopicHandler,null,1,1));
            _tagSettings.Add(LinkTag,new TagSettings(true,(StartTagHandlerDelegate)StartLinkHandler,"</a>",1,1));
            _tagSettings.Add(TableTag,new TagSettings(true,(StartTagHandlerDelegate)StartTableHandler,(EndTagHandlerDelegate)EndTableHandler,1,3));
            _tagSettings.Add(TableCellTag,new TagSettings(true,(StartTagHandlerDelegate)StartTableCellHandler,(EndTagHandlerDelegate)EndTableCellHandler,0,1));
            _tagSettings.Add(SeeAlsoTag,new TagSettings(false,(StartTagHandlerDelegate)StartSeeAlsoHandler,null,1,Int32.MaxValue));
            _tagSettings.Add(LogicTag,new TagSettings(true,"",(EndTagHandlerDelegate)EndLogicHandler,0,0));
            _tagSettings.Add(LogicColorTag,new TagSettings(true,"",(EndTagHandlerDelegate)EndLogicColorHandler,0,0));
            _tagSettings.Add(PffTag,new TagSettings(true,"",(EndTagHandlerDelegate)EndPffHandler,0,0));
            _tagSettings.Add(PffColorTag,new TagSettings(true,"",(EndTagHandlerDelegate)EndPffColorHandler,0,0));
            _tagSettings.Add(HtmlTag,new TagSettings("",""));

            _blockTags = new Dictionary<string,string>();
            _blockTags.Add(MakeTag(LogicTag,true),MakeTag(LogicTag,false));
            _blockTags.Add(MakeTag(PffTag,true),MakeTag(PffTag,false));
            _blockTags.Add(MakeTag(HtmlTag,true),MakeTag(HtmlTag,false));
        }
 public GenerateWebsiteTopicCompilerSettings(HelpComponents helpComponents)
 {
     _helpComponents = helpComponents;
 }
Example #13
0
 public string CompileForHtml(string[] lines,HelpComponents helpComponents,TopicCompilerSettingsInterface topicCompilerSettings)
 {
     TopicCompiler topicCompiler = new TopicCompiler(helpComponents,_preprocessedTopic,topicCompilerSettings);
     return topicCompiler.CompileForHtml(lines);
 }
Example #14
0
        public MainForm()
        {
            InitializeComponent();

            _helpComponents = new HelpComponents();
        }
Example #15
0
        public MainForm()
        {
            InitializeComponent();

            _helpComponents = new HelpComponents();
        }
Example #16
0
 public TopicCompiler(Form form, HelpComponents helpComponents, Preprocessor.TopicPreprocessor preprocessedTopic,
                      TopicCompilerSettingsInterface topicCompilerSettings)
     :   this(new CSPro.Logic.Colorizer(form.Handle.ToInt32()), helpComponents, preprocessedTopic, topicCompilerSettings)
 {
 }