public static void Configure(Action <InfoPageConfiguration> conf) { StackFrame frame = new StackFrame(1); var method = frame.GetMethod(); var type = method.DeclaringType; InfoPageConfiguration settings = new InfoPageConfiguration(); settings.MainAssembly = type.Assembly; settings.ApplicationName = settings.MainAssembly.GetName().Name; settings.ApplicationSubtitle = "info about this application"; conf.Invoke(settings); InfoPageConfigurator._current = settings; }
public static InfoPageModel GetInfoPage(InfoPageConfiguration conf) { InfoPageModel ip = new InfoPageModel(); ip.MainAssembly = GetAssemblyMetadata(conf.MainAssembly); ip.LoadedAssemblies = GetLoadedAssemblies(); ip.Conf = conf; if (conf.ShowInfo) { ip.Info = GetMarkdownContent(conf.InfoPath); } if (conf.ShowLicense) { ip.License = GetMarkdownContent(conf.LicensePath); } if (conf.ShowChangeLog) { ip.ChangeLogs = GetMarkdownContent(conf.ChangeLogPath); } return(ip); }