Ejemplo n.º 1
0
 private async Task <IEnumerable <object> > GetTargets(MenuAction action)
 {
     if (ContextTargets != null)
     {
         return(ContextTargets);
     }
     else
     {
         return(await CurrentApplicationViewModel.GetMenuActionTargets(action));
     }
 }
 public async void Start()
 {
     try
     {
         await InnerTask;
     }
     catch (Exception ex)
     {
         CurrentApplicationViewModel.ReportError(ex);
     }
     IsCompleted = true;
     Completed?.Invoke(this, new EventArgs());
 }
Ejemplo n.º 3
0
        public async override Task MainAsync(string[] arguments)
        {
            await base.MainAsync(arguments);

            if (arguments.Length > 1)
            {
                var filename = arguments[1];
                var fileType = arguments.Length > 2 ? ReflectionHelpers.GetTypeByName(arguments[2], CurrentPluginManager) : null;

                if (fileType == null)
                {
                    await CurrentApplicationViewModel.OpenFile(filename);
                }
                else
                {
                    await CurrentApplicationViewModel.OpenFile(filename, fileType);
                }
            }
            else
            {
                Console.WriteLine(Properties.Resources.Console_OpenFile_Usage);
            }
        }