Beispiel #1
0
 public override string Execute <TOwner>(IUIComponent <TOwner> component)
 {
     return(Source.HasValue
         ? ContentExtractor.Get(component, Source.Value)
         : !string.IsNullOrWhiteSpace(AttributeName)
         ? component.Attributes[AttributeName]
         : throw new InvalidOperationException($"Cannot execute as none of {Source} or {AttributeName} properties is set."));
 }
Beispiel #2
0
 /// <summary>
 /// Gets the <see cref="DataProvider{TData, TOwner}"/> instance for the text content using <paramref name="source"/> argument.
 /// </summary>
 /// <param name="source">The source of the content.</param>
 /// <returns>The <see cref="DataProvider{TData, TOwner}"/> instance for the text content.</returns>
 public DataProvider <string, TOwner> GetContent(ContentSource source)
 {
     return(GetOrCreateDataProvider($"content ({source.ToString(TermCase.MidSentence)})", () => ContentExtractor.Get(this, source)));
 }