public void Add(eContentDomain domain, string name, Func <string> content) { if (DomainCheck.IsAllowed(_contentDomain, domain)) { _content.AddOrUpdate(name, (key) => content(), (key, oldValue) => content()); } }
public QuokkaContainer WithContentDomain(eContentDomain contentDomain) { EnsureNotInitialized(); _builder .RegisterInstance(new ContentDomainProvider(contentDomain)) .AsImplementedInterfaces() .SingleInstance(); return(this); }
public static void WriteLine(this ILogStream stream, eContentDomain domain, ConsoleColor foreground, string format = null, params object[] args) { stream.Log(new LogRecord() { Items = new List <LogRecordItem>() { new LogRecordItem() { Domain = domain, Foreground = foreground, Message = format != null ? string.Format(format, args) : null, NewLine = true } } }); }
public static bool IsAllowed(eContentDomain allowed, eContentDomain requested) { switch (allowed) { case eContentDomain.Public: if (requested == eContentDomain.Public) { return(true); } break; case eContentDomain.Trusted: if (requested == eContentDomain.Public || requested == eContentDomain.Trusted) { return(true); } break; case eContentDomain.Private: return(true); } return(false); }
public static void WriteLine(this ILogStream stream, eContentDomain domain, string format = null, params object[] args) { stream.WriteLine(domain, ConsoleColor.White, format, args); }
public BaseLogStream(IContentDomainProvider contentDomainProvider) { _contentDomain = contentDomainProvider.ContentDomain; }
public ContentDomainProvider(eContentDomain contentDomain) { ContentDomain = contentDomain; }
public VirtualFS(IContentDomainProvider contentDomainProvider) { _contentDomain = contentDomainProvider.ContentDomain; }