Beispiel #1
0
        public void Bind(IBindRequest request)
        {
            var template   = request.Target;
            var tracer     = request.Logger;
            var masterName = request.Master ?? MasterName;

            var master = _sharedTemplateLocator.LocateMaster(masterName, template, request.TemplateRegistry);

            if (master == null)
            {
                tracer.Log(template, "Expected master page [{0}] not found.", masterName);
                return;
            }

            template.Descriptor.As <ViewDescriptor>().Master = master;
            tracer.Log(template, "Master page [{0}] found at {1}", masterName, master.FilePath);
        }
Beispiel #2
0
        public void Attach(IAttachRequest request)
        {
            var template = request.Template;
            var tracer   = request.Logger;

            var masterName = _registrations.ParsingFor(template).Master ?? MasterName;
            var master     = _templateLocator.LocateMaster(masterName, template);

            if (master == null)
            {
                var notFound = "Expected master page [{0}] not found.".ToFormat(masterName);
                tracer.Log(template, notFound);
                return;
            }

            template.Descriptor.As <ViewDescriptor>().Master = master;
            var found = "Master page [{0}] found at {1}".ToFormat(masterName, master.FilePath);

            tracer.Log(template, found);
        }
Beispiel #3
0
        public void Attach(IAttachRequest <T> request)
        {
            var template = request.Template;
            var tracer   = request.Logger;

            var layoutName = _parsing.ParsingFor(template).Master ?? MasterName;
            var layout     = _sharedTemplateLocator.LocateMaster(layoutName, template);

            if (layout == null)
            {
                var notFound = "Expected master [{0}] not found.".ToFormat(layoutName);
                tracer.Log(template, notFound);
                return;
            }

            template.Descriptor.As <ViewDescriptor <T> >().Master = layout;
            var found = "Master [{0}] found at {1}".ToFormat(layoutName, layout.FilePath);

            tracer.Log(template, found);
        }