public static AasxPluginResultLicense CompileAllLicenses() { // make an empty one var res = new AasxPluginResultLicense(); res.shortLicense = ""; res.longLicense = ""; // over all loaded plugins foreach (var pi in LoadedPlugins.Values) { try { var x = pi.InvokeAction("get-licenses") as AasxPluginResultLicense; if (x != null) { if (x.shortLicense.HasContent()) { res.shortLicense += x.shortLicense + Environment.NewLine; } if (!x.isStandardLicense && x.longLicense.HasContent()) { res.longLicense += $"[{pi.name}]" + Environment.NewLine; res.longLicense += x.longLicense + Environment.NewLine + Environment.NewLine; } } } catch (Exception ex) { AdminShellNS.LogInternally.That.Error( ex, $"Failed to load the license from the plugin: {pi.name} from {pi.asm.Location}"); } } // OK return(res); }
public static AasxPluginResultLicense CompileAllLicenses() { // make an empty one var res = new AasxPluginResultLicense(); res.shortLicense = ""; res.longLicense = ""; // over all loaded plugins foreach (var pi in LoadedPlugins.Values) { // ReSharper disable EmptyGeneralCatchClause try { var x = pi.InvokeAction("get-licenses") as AasxPluginResultLicense; if (x != null) { if (x.shortLicense.HasContent()) { res.shortLicense += x.shortLicense + Environment.NewLine; } if (!x.isStandardLicense && x.longLicense.HasContent()) { res.longLicense += $"[{pi.name}]" + Environment.NewLine; res.longLicense += x.longLicense + Environment.NewLine + Environment.NewLine; } } } catch { } // ReSharper enable EmptyGeneralCatchClause } // OK return(res); }