Ejemplo n.º 1
0
 public static IGrammarComponent Grammars(this IAppExtensions _)
 {
     if (_grammar == null)
     {
         _grammar = App.Component <IGrammarComponent>();
     }
     return(_grammar);
 }
Ejemplo n.º 2
0
 public static ExecResult Handle(this IAppExtensions _, Action act)
 {
     try
     {
         act();
         return(ExecResult.Ok);
     }
     catch (Exception ex)
     {
         return(ExecResult.Failure(ex.Message));
     }
 }
Ejemplo n.º 3
0
 public static MessageButtons Show(this IAppExtensions _, string caption, string text, MessageButtons buttons = MessageButtons.Close)
 {
     return(App.Catalog <IMessageBox>().Default().Show(caption, text, buttons));
 }
Ejemplo n.º 4
0
 public static void Log(this IAppExtensions _, string message, EntryType type)
 {
     App.Catalog <ILogComponent>().GetComponent(logKey).Write(message, type);
 }
Ejemplo n.º 5
0
        public static bool Run(this IAppExtensions _, IEditor editor, Identifier key, params object[] args)
        {
            var disp = App.Catalog <ICommandDispatcher>().GetComponent(key.Namespace);

            return(disp != null?disp.Execute(editor, key, args) : false);
        }
Ejemplo n.º 6
0
        public static bool Run(this IAppExtensions _, Identifier key, params object[] args)
        {
            var view = App.Component <IViewManager>().ActiveView;

            return(Run(null, view.Editor, key, args));
        }