예제 #1
0
        /// <summary>
        /// Creates a new insteace of <see cref="LibraryManagerDialog"/>.
        /// </summary>
        /// <param name="libraryManagerFactory">A factory that creates an <see cref="ILibraryManager"/> instance.</param>
        /// <param name="librarySourceManagerDialogFactory">A factory that creates an <see cref="LibrarySourceManagerDialog"/> instance.</param>
        public LibraryManagerDialog(Func <ILibraryManager> libraryManagerFactory, Func <LibrarySourceManagerDialog> librarySourceManagerDialogFactory)
        {
            LibraryManager = libraryManagerFactory();
            _librarySourceManagerDialog = librarySourceManagerDialogFactory();

            CommandBarCommands.Add(new DialogCommandBarCommand("Open Plugin Directory", OpenPluginsDirectory));
            CommandBarCommands.Add(new DialogCommandBarCommand("Manage Plugin Sources", ViewSources));
        }
예제 #2
0
 private MessageBox(string title, string message, IList <DialogCommandBarCommand> choices)
 {
     Title   = title;
     Message = message;
     foreach (var choice in choices)
     {
         CommandBarCommands.Add(new DialogCommandBarCommand(choice.Label, () => { CloseDialog(); choice.Action(); }));
     }
 }
 /// <summary>
 /// Creates a new instance of <see cref="ExceptionDialog"/>.
 /// </summary>
 /// <param name="exception">The exception to display the information of in the dialog.</param>
 public ExceptionDialog(Exception exception)
 {
     _exception = exception;
     Title = _exception.GetType().Name;
     Message = _exception.Message;
     while (_exception.InnerException != null)
     {
         _exception = _exception.InnerException;
         Message += $"\n\nInner Exception: {_exception.GetType().Name}\n Message: {_exception.Message}";
     }
     CommandBarCommands.Add(new DialogCommandBarCommand("Copy Exception", CopyExceptionButtonPressed));
 }
 public SaveProjectDialog()
 {
     CommandBarCommands.Add(new DialogCommandBarCommand("Save", Save));
 }