|
|
@@ -18,35 +18,6 @@ namespace QuestPDF.Helpers
|
|
|
SkNativeDependencyCompatibilityChecker.Test();
|
|
|
}
|
|
|
|
|
|
- internal static byte[] LoadEmbeddedResource(string resourceName)
|
|
|
- {
|
|
|
- using var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName);
|
|
|
- using var reader = new BinaryReader(stream);
|
|
|
-
|
|
|
- return reader.ReadBytes((int) stream.Length);
|
|
|
- }
|
|
|
-
|
|
|
- private static PropertyInfo? ToPropertyInfo<T, TValue>(this Expression<Func<T, TValue>> selector)
|
|
|
- {
|
|
|
- return (selector.Body as MemberExpression)?.Member as PropertyInfo;
|
|
|
- }
|
|
|
-
|
|
|
- internal static string? GetPropertyName<T, TValue>(this Expression<Func<T, TValue>> selector) where TValue : class
|
|
|
- {
|
|
|
- return selector.ToPropertyInfo()?.Name;
|
|
|
- }
|
|
|
-
|
|
|
- internal static TValue? GetPropertyValue<T, TValue>(this T target, Expression<Func<T, TValue>> selector) where TValue : class
|
|
|
- {
|
|
|
- return selector.ToPropertyInfo()?.GetValue(target) as TValue;
|
|
|
- }
|
|
|
-
|
|
|
- internal static void SetPropertyValue<T, TValue>(this T target, Expression<Func<T, TValue>> selector, TValue value)
|
|
|
- {
|
|
|
- var property = selector.ToPropertyInfo() ?? throw new Exception("Expected property with getter and setter.");
|
|
|
- property?.SetValue(target, value);
|
|
|
- }
|
|
|
-
|
|
|
internal static string PrettifyName(this string text)
|
|
|
{
|
|
|
return Regex.Replace(text, @"([a-z])([A-Z])", "$1 $2", RegexOptions.Compiled);
|