Comment and UnComment XML

SyntaxEditor for Windows Forms Forum

Posted 2 years ago by Peter Treier
Version: 16.1.0330
Avatar

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)

Answer - Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

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 2 years ago by Peter Treier
Avatar

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

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

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

The latest build of this product (v2018.1 build 0342) was released 12 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.