Question

Comment and UnComment XML

Posted 10 months ago by Avatar Peter Treier

Hi all

I try to get the syntax editor to run.
At the moment I'm having trouble getting XML commenting to run.
One or more lines of XML should be commented or uncommented.

 

Here is my code

 

 var xmlLanguage = new XmlSyntaxLanguage();
      syntaxEditor.Document.Language = xmlLanguage;

      //try
      //{
      //  var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("XTOOLZ.X_Edit.Editor.Lexers.ActiproSoftware.XML.xml");
      //  syntaxEditor.Document.LoadLanguageFromXml(stream, 0);
      //}
      //catch (Exception e)
      //{
      //  Console.WriteLine(e);

      //}

      SemanticParserService.Start();
      //syntaxEditor.Document.Language.LineCommentDelimiter="<!--";

      syntaxEditor.Document.Outlining.Mode = OutliningMode.Automatic;
      syntaxEditor.Document.SemanticParsingEnabled = true;
      syntaxEditor.Document.LexicalParsingEnabled = true;
      syntaxEditor.Document.LineModificationMarkingEnabled = true;

      _schemaResolver = new XmlSchemaResolver();
      syntaxEditor.Document.LanguageData = _schemaResolver;

 The Comment/Uncomment is done like that

syntaxEditor.SelectedView.UncommentLines();

syntaxEditor.SelectedView.CommentLines();

 The good thing, no error occures - the bad, the code doesn't comment the xml :-/

Any Help is welcome !

Peter


Comments (3)

Posted 10 months ago by Actipro Software Support - Cleveland, OH, USA

Hi Peter,

I'm sorry but the XML language in WinForms doesn't currently support commenting/uncommenting.  The newer WPF version's XML language does.  We are currently working on trying to unify the codebases of SyntaxEditor across platforms to be like the WPF version so that everything will have the same feature set.  Please see our blog for details as this project is code-named "SyntaxEditor vNext".  If we can get the WinForms version ported using that framework, then it will end up with the same API and features as what is in the WPF version.

Anyhow for now in the current WinForms SyntaxEditor, you'd need to write custom code to add the <!-- and --> around the selection.


Actipro Software Support
Posted 10 months ago by Peter Treier

Is there a release date available for the Winform Syntaxeditor on the new Codebase?

Posted 10 months ago by Actipro Software Support - Cleveland, OH, USA

Sorry we're not anywhere close to a release of vNext yet, so we can't really estimate when it will be ready for testing.  We'll continue posting progress in the blog though so please monitor that for updates.


Actipro Software Support
Information The latest build of this product (2018.1 build 0340) was released 6 months ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.