Exemplo n.º 1
0
		/// <summary>
		/// Shows a dialog in which one can rename a list of documents (graphs, worksheets).
		/// </summary>
		/// <param name="objectsToRename">The documents to rename.</param>
		public static void ShowRenameDocumentsDialog(IEnumerable<object> objectsToRename)
		{
			var renameData = new Altaxo.Gui.Common.MultiRename.MultiRenameData();
			renameData.AddObjectsToRename(objectsToRename);

			renameData.RegisterListColumn("Full name", Main.Commands.MultiRenameDocuments.GetFullName);
			renameData.RegisterListColumn("New name", null);
			renameData.RegisterListColumn("Creation date", Main.Commands.MultiRenameDocuments.GetCreationDateString);

			Main.Commands.MultiRenameDocuments.RegisterCommonDocumentShortcuts(renameData);

			renameData.DefaultPatternString = "[N]";

			renameData.RegisterRenameActionHandler(RenameDocuments);

			var controller = new Altaxo.Gui.Common.MultiRename.MultiRenameController();
			controller.InitializeDocument(renameData);

			Current.Gui.ShowDialog(controller, "Rename items");
		}
Exemplo n.º 2
0
        /// <summary>
        /// Shows a dialog in which one can rename a list of documents (graphs, worksheets).
        /// </summary>
        /// <param name="objectsToRename">The documents to rename.</param>
        public static void ShowRenameDocumentsDialog(IEnumerable <object> objectsToRename)
        {
            var renameData = new Altaxo.Gui.Common.MultiRename.MultiRenameData();

            renameData.AddObjectsToRename(objectsToRename);

            renameData.RegisterListColumn("Full name", Main.Commands.MultiRenameDocuments.GetFullName);
            renameData.RegisterListColumn("New name", null);
            renameData.RegisterListColumn("Creation date", Main.Commands.MultiRenameDocuments.GetCreationDateString);

            Main.Commands.MultiRenameDocuments.RegisterCommonDocumentShortcuts(renameData);

            renameData.DefaultPatternString = "[N]";

            renameData.RegisterRenameActionHandler(RenameDocuments);

            var controller = new Altaxo.Gui.Common.MultiRename.MultiRenameController();

            controller.InitializeDocument(renameData);

            Current.Gui.ShowDialog(controller, "Rename items");
        }
Exemplo n.º 3
0
		/// <summary>Shows the multi file export dialog and exports the graphs, using the <see cref="GraphExportOptions"/> that are stored in this class.</summary>
		/// <param name="documents">List with graph documents to export.</param>
		public static void ShowExportMultipleGraphsDialog(IEnumerable<Graph.Gdi.GraphDocument> documents)
		{
			MultiRenameData mrData = new MultiRenameData();
			MultiRenameDocuments.RegisterCommonDocumentShortcuts(mrData);
			mrData.RegisterStringShortcut("E", (o, i) => _graphExportOptionsToFile.GetDefaultFileNameExtension(), "File extension (depends on the image type that was chosen before");

			mrData.RegisterRenameActionHandler(DoExportGraphs);

			mrData.AddObjectsToRename(documents);

			mrData.RegisterListColumn("FullName", MultiRenameDocuments.GetFullName);
			mrData.RegisterListColumn("File name", null);
			mrData.RegisterListColumn("Creation date", MultiRenameDocuments.GetCreationDateString);

			mrData.DefaultPatternString = "[SN][E]";

			MultiRenameController mrController = new MultiRenameController();
			mrController.InitializeDocument(mrData);
			Current.Gui.ShowDialog(mrController, "Export multiple graphs");
		}