Example #1
0
        private IDetailBlockStart FindBlockStart(Func <IDetailBlockStart, bool> predicate)
        {
            // As a possibly premature optimization, check the parent container first as
            // semantically correct nesting will have it there
            var container = this.Parent as IRDomContainer;

            if (container != null)
            {
                var fromParent = container.GetMembers()
                                 .OfType <IDetailBlockStart>()
                                 .Where(predicate)
                                 .FirstOrDefault();
                if (fromParent != null)
                {
                    return(fromParent);
                }
            }
            var rootOrBase  = Ancestors.Last(); // Root
            var descendants = rootOrBase.Descendants
                              .OfType <IDetailBlockStart>()
                              .Where(predicate)
                              .FirstOrDefault();

            if (descendants != null)
            {
                return(descendants);
            }
            throw new InvalidOperationException("Matching end region not found");
        }
Example #2
0
 public void Write(Severity type, object context, string format, object arg0, object arg1 = null)
 {
     Sink.Write(type, context ?? Ancestors.Last(), format, arg0, arg1);
 }
Example #3
0
 public void Write(Severity type, object context, string format, params object[] args)
 {
     Sink.Write(type, context ?? Ancestors.Last(), format, args);
 }
Example #4
0
 public void Write(Severity type, object context, string format)
 {
     Sink.Write(type, context ?? Ancestors.Last(), format);
 }