Office code cleanup, this could improve the COM-object usage a bit.

This commit is contained in:
RKrom 2014-03-17 14:54:27 +01:00
commit d27df3027b
5 changed files with 252 additions and 188 deletions

View file

@ -133,7 +133,7 @@ namespace GreenshotOfficePlugin {
}
public override IEnumerable<IDestination> DynamicDestinations() {
Dictionary<string, OlObjectClass> inspectorCaptions = OutlookEmailExporter.RetrievePossibleTargets(conf.OutlookAllowExportInMeetings);
Dictionary<string, OlObjectClass> inspectorCaptions = OutlookEmailExporter.RetrievePossibleTargets();
if (inspectorCaptions != null) {
foreach (string inspectorCaption in inspectorCaptions.Keys) {
yield return new OutlookDestination(inspectorCaption, inspectorCaptions[inspectorCaption]);
@ -175,7 +175,7 @@ namespace GreenshotOfficePlugin {
exportInformation.ExportMade = true;
} else {
if (!manuallyInitiated) {
Dictionary<string, OlObjectClass> inspectorCaptions = OutlookEmailExporter.RetrievePossibleTargets(conf.OutlookAllowExportInMeetings);
Dictionary<string, OlObjectClass> inspectorCaptions = OutlookEmailExporter.RetrievePossibleTargets();
if (inspectorCaptions != null && inspectorCaptions.Count > 0) {
List<IDestination> destinations = new List<IDestination>();
destinations.Add(new OutlookDestination());