Exemplo n.º 1
0
 public static ToolOutputParser OpenToolOutput([DefaultVar] ppParser parser, string name)
 {
     for (int i = 0; i < parser.Subfiles.Count; i++)
     {
         if (parser.Subfiles[i].Name == name)
         {
             IReadFile subfile = parser.Subfiles[i] as IReadFile;
             if (subfile != null)
             {
                 return(new ToolOutputParser(subfile.CreateReadStream(), subfile.Name));
             }
             IWriteFile writeFile = parser.Subfiles[i] as IWriteFile;
             if (writeFile != null)
             {
                 using (MemoryStream memStream = new MemoryStream())
                 {
                     writeFile.WriteTo(memStream);
                     memStream.Position = 0;
                     ToolOutputParser outParser = new ToolOutputParser(memStream, writeFile.Name);
                     outParser.readFromOtherParser = true;
                     return(outParser);
                 }
             }
             break;
         }
     }
     return(null);
 }
Exemplo n.º 2
0
 public ToolOutputEditor(ToolOutputParser parser, int ppFormatIndex)
 {
     Parser             = parser;
     this.ppFormatIndex = ppFormatIndex;
     extension          = Path.GetExtension(parser.Name);
     Text = GetData();
 }
Exemplo n.º 3
0
        public FormToolOutput(ppParser ppParser, string toolOutputParserVar)
        {
            InitializeComponent();

            ToolOutputParser parser = (ToolOutputParser)Gui.Scripting.Variables[toolOutputParserVar];

            if (parser.readFromOtherParser)
            {
                syntaxHighlightingTextBoxToolOutput.ReadOnly = true;
            }

            this.ShowHint    = DockState.Document;
            this.Text        = parser.Name;
            this.ToolTipText = ppParser.FilePath + @"\" + parser.Name;

            ParserVar = toolOutputParserVar;

            EditorVar = Gui.Scripting.GetNextVariable("toolOutputEditor");
            Editor    = (ToolOutputEditor)Gui.Scripting.RunScript(EditorVar + " = ToolOutputEditor(parser=" + ParserVar + ", ppFormatIndex=" + (int)ppParser.Format.ppFormatIdx + ")");

            checkBoxWordWrap.Checked = syntaxHighlightingTextBoxToolOutput.WordWrap;
            syntaxHighlightingTextBoxToolOutput.ScrollBars = RichTextBoxScrollBars.Both & RichTextBoxScrollBars.ForcedBoth;

            syntaxHighlightingTextBoxToolOutput.Seperators.Add('\t');
            syntaxHighlightingTextBoxToolOutput.HighlightDescriptors.Add(new HighlightDescriptor("//", Color.DimGray, null, DescriptorType.ToEOL, DescriptorRecognition.StartsWith, false));

            syntaxHighlightingTextBoxToolOutput.InitText(Editor.Text);
            syntaxHighlightingTextBoxToolOutput.TextChanged += new EventHandler(syntaxHighlightingTextBoxToolOutput_TextChanged);

            syntaxHighlightingTextBoxToolOutput.DragDrop          += new DragEventHandler(syntaxHighlightingTextBoxToolOutput_DragDrop);
            syntaxHighlightingTextBoxToolOutput.EnableAutoDragDrop = true;

            Gui.Docking.ShowDockContent(this, Gui.Docking.DockEditors, ContentCategory.Others);
        }
Exemplo n.º 4
0
 public ToolOutputEditor(ToolOutputParser parser, int ppFormatIndex)
 {
     Parser = parser;
     this.ppFormatIndex = ppFormatIndex;
     extension = Path.GetExtension(parser.Name);
     Text = GetData();
 }
Exemplo n.º 5
0
 public static ToolOutputParser OpenToolOutput([DefaultVar]ppParser parser, string name)
 {
     for (int i = 0; i < parser.Subfiles.Count; i++)
     {
         if (parser.Subfiles[i].Name == name)
         {
             IReadFile subfile = parser.Subfiles[i] as IReadFile;
             if (subfile != null)
             {
                 return new ToolOutputParser(subfile.CreateReadStream(), subfile.Name);
             }
             IWriteFile writeFile = parser.Subfiles[i] as IWriteFile;
             if (writeFile != null)
             {
                 using (MemoryStream memStream = new MemoryStream())
                 {
                     writeFile.WriteTo(memStream);
                     memStream.Position = 0;
                     ToolOutputParser outParser = new ToolOutputParser(memStream, writeFile.Name);
                     outParser.readFromOtherParser = true;
                     return outParser;
                 }
             }
             break;
         }
     }
     return null;
 }