protected virtual IEnumerable<IControlPanelControl> GetDefaultControls()
        {
            var hasSerializedItems = Configurations.All(ControlPanelUtility.HasAnySerializedItems);
            var hasValidSerializedItems = Configurations.All(ControlPanelUtility.HasAnySourceItems);

            var isAuthorized = Authorization.IsAllowed;

            yield return new Html5HeadAndStyles();

            var heading = new Heading();
            heading.HasSerializedItems = hasSerializedItems;
            heading.HasValidSerializedItems = hasValidSerializedItems;
            heading.IsAuthenticated = isAuthorized;
            yield return heading;

            if (isAuthorized)
            {
                if (Configurations.Length > 1 && hasSerializedItems && hasValidSerializedItems)
                {
                    yield return new Literal("<h2>Global Actions</h2>");

                    yield return new ControlOptions();

                    yield return new Literal("<h2>Configurations</h2>");
                }

                foreach (var configuration in Configurations)
                {
                    var configurationHasSerializedItems = ControlPanelUtility.HasAnySerializedItems(configuration);
                    var configurationHasValidRootItems = ControlPanelUtility.HasAnySourceItems(configuration);

                    yield return new Literal("<div class=\"configuration\"><h3>{0}</h3><section>".FormatWith(configuration.Name));

                    if(!configurationHasValidRootItems)
                        yield return new Literal("<p class=\"warning\">This configuration's predicate cannot resolve any valid root items. This usually means it is configured to look for nonexistant paths or GUIDs. Please review your predicate configuration.</p>");
                    else if (!configurationHasSerializedItems)
                        yield return new Literal("<p class=\"warning\">This configuration does not currently have any valid serialized items. You cannot sync it until you perform an initial serialization.</p>");

                    if (configurationHasSerializedItems)
                    {
                        var controlOptions = configuration.Resolve<ControlOptions>();
                        controlOptions.ConfigurationName = configuration.Name;
                        yield return controlOptions;
                    }

                    var configDetails = configuration.Resolve<ConfigurationDetails>();
                    configDetails.ConfigurationName = configuration.Name;
                    configDetails.CollapseByDefault = configurationHasSerializedItems;
                    yield return configDetails;

                    if (!configurationHasSerializedItems)
                    {
                        yield return new InitialSetup(configuration);
                    }

                    yield return new Literal("</section></div>");
                }
            }
            else
            {
                yield return new AccessDenied();
            }

            yield return new Html5Footer();
        }
        protected virtual IEnumerable <IControlPanelControl> GetDefaultControls()
        {
            var hasSerializedItems      = Configurations.All(ControlPanelUtility.HasAnySerializedItems);
            var hasValidSerializedItems = Configurations.All(ControlPanelUtility.HasAnySourceItems);

            var isAuthorized = Authorization.IsAllowed;

            yield return(new Html5HeadAndStyles());

            var heading = new Heading();

            heading.HasSerializedItems      = hasSerializedItems;
            heading.HasValidSerializedItems = hasValidSerializedItems;
            heading.IsAuthenticated         = isAuthorized;
            yield return(heading);

            if (isAuthorized)
            {
                if (Configurations.Length > 1 && hasSerializedItems && hasValidSerializedItems)
                {
                    yield return(new Literal("<h2>Global Actions</h2>"));

                    yield return(new ControlOptions());

                    yield return(new Literal("<h2>Configurations</h2>"));
                }

                foreach (var configuration in Configurations)
                {
                    var configurationHasSerializedItems = ControlPanelUtility.HasAnySerializedItems(configuration);
                    var configurationHasValidRootItems  = ControlPanelUtility.HasAnySourceItems(configuration);

                    yield return(new Literal("<div class=\"configuration\"><h3>{0}</h3><section>".FormatWith(configuration.Name)));

                    if (!configurationHasValidRootItems)
                    {
                        yield return(new Literal("<p class=\"warning\">This configuration's predicate cannot resolve any valid root items. This usually means it is configured to look for nonexistant paths or GUIDs. Please review your predicate configuration.</p>"));
                    }
                    else if (!configurationHasSerializedItems)
                    {
                        yield return(new Literal("<p class=\"warning\">This configuration does not currently have any valid serialized items. You cannot sync it until you perform an initial serialization.</p>"));
                    }

                    if (configurationHasSerializedItems)
                    {
                        var controlOptions = configuration.Resolve <ControlOptions>();
                        controlOptions.ConfigurationName = configuration.Name;
                        yield return(controlOptions);
                    }

                    var configDetails = configuration.Resolve <ConfigurationDetails>();
                    configDetails.ConfigurationName = configuration.Name;
                    configDetails.CollapseByDefault = configurationHasSerializedItems;
                    yield return(configDetails);

                    if (!configurationHasSerializedItems)
                    {
                        yield return(new InitialSetup(configuration));
                    }

                    yield return(new Literal("</section></div>"));
                }
            }
            else
            {
                yield return(new AccessDenied());
            }

            yield return(new Html5Footer());
        }