public Task Run(MesCommand command)
        {
            throw new NotImplementedException();

#if false
            var tag    = (NewFileTag)command.Tag;
            var editor = tag.EditorProvider.Create();

            var viewAware = (IViewAware)editor;
            viewAware.ViewAttached += (sender, e) =>
            {
                var frameworkElement = (FrameworkElement)e.View;

                RoutedEventHandler loadedHandler = null;
                loadedHandler = async(sender2, e2) =>
                {
                    frameworkElement.Loaded -= loadedHandler;
                    await tag.EditorProvider.New(editor, string.Format(Resources.FileNewUntitled, (_newFileCounter++) + tag.FileType.FileExtension));
                };
                frameworkElement.Loaded += loadedHandler;
            };

            _shell.OpenDocument(editor);

            return(TaskUtility.Completed);
#endif
        }
 public void Update(MesCommand command)
 {
     if (_updateMethod != null)
     {
         _updateMethod.Invoke(_commandHandler, new object[] { command });
     }
 }
 public void Populate(MesCommand command, List <MesCommand> commands)
 {
     if (_populateMethod == null)
     {
         throw new InvalidOperationException("Populate can only be called for list-type commands.");
     }
     _populateMethod.Invoke(_commandHandler, new object[] { command, commands });
 }
 public void Populate(MesCommand command, List <MesCommand> commands)
 {
     for (Int32 i = 0; i < _shell.Documents.Count; i++)
     {
         IMesDocument document = _shell.Documents[i];
         commands.Add(new MesCommand(command.CommandDefinition)
         {
             Checked = _shell.ActiveItem == document,
             Text    = String.Format("_{0} {1}", i + 1, document.DisplayName),
             Tag     = document
         });
     }
 }
 public void Populate(MesCommand command, List <MesCommand> commands)
 {
     foreach (IMesEditorProvider editorProvider in _editorProviders)
     {
         foreach (MesEditorFileType editorFileType in editorProvider.FileTypes)
         {
             commands.Add(new MesCommand(command.CommandDefinition)
             {
                 Text = editorFileType.Name,
                 Tag  = new NewFileTag
                 {
                     EditorProvider = editorProvider,
                     FileType       = editorFileType
                 }
             });
         }
     }
 }
 public override Task Run(MesCommand command)
 {
     _shell.ShowTool <IMesHistoryTool>();
     return(MesTaskUtility.Completed);
 }
Beispiel #7
0
 public override Task Run(MesCommand command) => throw new System.NotImplementedException();
 public abstract Task Run(MesCommand command);
 public virtual void Update(MesCommand command)
 {
 }
 public Task Run(MesCommand command) => (Task)_runMethod.Invoke(_commandHandler, new object[] { command });
 public Task Run(MesCommand command)
 {
     _shell.OpenDocument((IMesDocument)command.Tag);
     return(MesTaskUtility.Completed);
 }