/// <summary> /// Register common shortcuts that are available for all documents (worksheets and graphs), like name, path, creation date etc. /// </summary> /// <param name="renameData">Rename data structure in which the shortcuts have to be registered.</param> public static void RegisterCommonDocumentShortcuts(MultiRenameData renameData) { renameData.RegisterStringShortcut("N", GetFullName, "Name of the object (full name, with path)"); renameData.RegisterStringShortcut("SN", GetShortName, "Short name of the object (without path"); renameData.RegisterStringShortcut("PN", GetFolderName, "Path name of the object"); renameData.RegisterIntegerShortcut("C", GetCounter, "Index of the object in the list"); renameData.RegisterDateTimeShortcut("CD", GetCreationDate, "Creation date of the object"); renameData.RegisterStringArrayShortcut("NA", GetNamePartArray, "Name array, i.e. full name split into individual path pieces"); renameData.RegisterStringArrayShortcut("PA", GetFolderPartArray, "Path array, i.e. path name of the object split into individual path pieces"); }
/// <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"); }