My tool to personal uses

Former Member
Former Member

In many times i going to Macro Manager Docker to creates C# macros, c# macros have the advantage over addons becauses dont requires
close and reopen coreldraw all times when the codes changes, is very usuful to makes tests, but if you code breaks coreldraw crashes
and the visual studio will close then is heigher the risk to lost the lasts changes in code. Another disadvantageis require the
specifique version of visual studio.

To work around this disadvantage and maintains the "hot code edit" vantage, i have creates a addon docker whose monitor a folder to display a tree wich
contains dll,class,method.

this docker will permits editions in dll files and not required reopen coreldraw similary Macro Manager Docker, but you dont lost code if coreldraw crashes
permits the use any visual studio version, and use VB not only C#
Uses the same macro official template, located in the <corel installation folder>/Data/VGCoreApp.vstax, but only requires custom attributes to works fine,
you can creates you self template
docs.microsoft.com/.../how-to-update-existing-templates

i has create a c# template, this template copys the created dll to "c:\cdrCommands", you can edit this path editing the file "ClassLibrary2.csproj",in line 54 and 55,
VGCore reference will needs update to target coreldraw version
to use in visual studio copy the zip to %USERPROFILE%\Documents\Visual Studio <version>\Templates\ProjectTemplates


In monitored folder can puts many dll.To create the dll use Class Library Template .net framework (not core, not standart) in visual studio
A dll can contains many class.
A class can contains many methods.

class require the attribute [CgsAddInModule] and [CgsAddInConstructor] in the constructor method, pass the coreldraw application object in the constructor
methods require the attribute [CgsAddInMacro]
this works like VSTA macros in Macro Manager.

after you can reuse yous dll in another projects.

I use many times the vsta macros to makes tests, i has create this tool to personal uses, but maybes helps you too

Source code: github.com/.../RunCommandDocker

Tests Demo: https://youtu.be/LT8luj9DFoA

Parents
No Data
Reply Children
No Data