MDrivenWiki
Log in

Modlr plugin

From MDrivenWiki
Revision as of 14:15, 23 October 2018 by Alexandra (talk | contribs) (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...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.