Changed the destination picker behavior to not sort, this makes it possible to do the sorting in the destinations itself. OneNote places the current page on top, the printer list also starts with the default... etc.

This commit is contained in:
RKrom 2014-07-29 16:13:12 +02:00
commit cc7f303e08
9 changed files with 31 additions and 8 deletions

View file

@ -133,7 +133,7 @@ namespace GreenshotOfficePlugin {
}
public override IEnumerable<IDestination> DynamicDestinations() {
Dictionary<string, OlObjectClass> inspectorCaptions = OutlookEmailExporter.RetrievePossibleTargets();
IDictionary<string, OlObjectClass> inspectorCaptions = OutlookEmailExporter.RetrievePossibleTargets();
if (inspectorCaptions != null) {
foreach (string inspectorCaption in inspectorCaptions.Keys) {
yield return new OutlookDestination(inspectorCaption, inspectorCaptions[inspectorCaption]);

View file

@ -54,6 +54,7 @@ namespace Greenshot.Interop.Office {
}
}
}
currentWorkbooks.Sort();
return currentWorkbooks;
}

View file

@ -56,8 +56,8 @@ namespace Greenshot.Interop.Office {
/// A method to retrieve all inspectors which can act as an export target
/// </summary>
/// <returns>List<string> with inspector captions (window title)</returns>
public static Dictionary<string, OlObjectClass> RetrievePossibleTargets() {
Dictionary<string, OlObjectClass> inspectorCaptions = new Dictionary<string, OlObjectClass>();
public static IDictionary<string, OlObjectClass> RetrievePossibleTargets() {
IDictionary<string, OlObjectClass> inspectorCaptions = new SortedDictionary<string, OlObjectClass>();
try {
using (IOutlookApplication outlookApplication = GetOutlookApplication()) {
if (outlookApplication == null) {

View file

@ -69,7 +69,7 @@ namespace Greenshot.Interop.Office {
} catch (Exception ex) {
LOG.Warn("Problem retrieving word destinations, ignoring: ", ex);
}
foundPresentations.Sort();
return foundPresentations;
}

View file

@ -227,6 +227,7 @@ namespace Greenshot.Interop.Office {
} catch (Exception ex) {
LOG.Warn("Problem retrieving word destinations, ignoring: ", ex);
}
openDocuments.Sort();
return openDocuments;
}