Modlr plugin
(Created page with "A Plugin interface is an easy way to allow for you to add your own extensions. We have now extended the Plugin with yet another interface to facilitate the adding of custom o...")
 
No edit summary
Line 31: Line 31:


Not going to repeat everything here but a few goodies.
Not going to repeat everything here but a few goodies.
namespace ModlrPluginCodeGenEventsAndCustomOCLOperations
{
  public class Plugindemo : IModlrPlugin, IModlrPluginMenuOperation, IModlrPluginModelAccessOclType, IModlrPluginImportantEventCallbackHandler
  {
    public string GetName()
    {
      return "AnotherPlugin";
    }

Revision as of 14:15, 23 October 2018

A Plugin interface is an easy way to allow for you to add your own extensions.

We have now extended the Plugin with yet another interface to facilitate the adding of custom ocl operations. This way the design time functions like CheckModel, ViewModels and OclEditor can be made to recognize your custom operations.

namespace Modlr.Plugins
{
public interface IModlrPlugin
{
string GetName();
List<IModlrPluginMenuOperation> ProvideOperations();
}
public interface IModlrPluginMenuOperation
{
string GetName();
void CheckEnableOrExecute(IEcoServiceProvider esp, bool execute, IEcoObject maincontext, IEcoObject subcontext,out bool enabled );
}
public enum CallbackEventKind {CodeGen,ForcedCodeGen };
public interface IModlrPluginImportantEventCallbackHandler
{
void ImportantEventAboutToHappen(IEcoServiceProvider esp, CallbackEventKind eventkind, ref bool stop, ref string message);
void ImportantEventHasHappend(IEcoServiceProvider esp, CallbackEventKind eventkind);
}
public interface IModlrPluginModelAccessOclType
{
/// <summary>
/// Possible usage - add custom ocl operations that can then be correctly executed by WECPOF and correctly evaluated in OCL design time
/// </summary>
void RuntimeModelAccess(IOclTypeService ocl);
}
}

I added an example in the demos folder called ModlrPluginCodeGenEventsAndCustomOCLOperations

Not going to repeat everything here but a few goodies.

namespace ModlrPluginCodeGenEventsAndCustomOCLOperations {   public class Plugindemo : IModlrPlugin, IModlrPluginMenuOperation, IModlrPluginModelAccessOclType, IModlrPluginImportantEventCallbackHandler   {     public string GetName()     {       return "AnotherPlugin";     }

This page was edited 69 days ago on 02/10/2024. What links here