コード例 #1
0
        private static NavigationConfig GetNavigationConfiguration(Component navConfigComponent)
        {
            NavigationConfig result = new NavigationConfig {
                NavType = NavigationType.Simple
            };

            if (navConfigComponent.Metadata == null)
            {
                return(result);
            }

            ItemFields navConfigComponentMetadataFields = new ItemFields(navConfigComponent.Metadata, navConfigComponent.MetadataSchema);
            Keyword    type = navConfigComponentMetadataFields.GetKeywordValue("navigationType");

            switch (type.Key.ToLower())
            {
            case "localizable":
                result.NavType = NavigationType.Localizable;
                break;
            }
            string navTextFields = navConfigComponentMetadataFields.GetSingleFieldValue("navigationTextFieldPaths");

            if (!string.IsNullOrEmpty(navTextFields))
            {
                result.NavTextFieldPaths = navTextFields.Split(',').Select(s => s.Trim()).ToList();
            }
            result.ExternalUrlTemplate = navConfigComponentMetadataFields.GetSingleFieldValue("externalLinkTemplate");
            return(result);
        }
コード例 #2
0
        private static NavigationConfig LoadConfig(Component component)
        {
            NavigationConfig res = new NavigationConfig {
                NavType = NavigationType.Simple
            };

            if (component.Metadata != null)
            {
                ItemFields meta = new ItemFields(component.Metadata, component.MetadataSchema);
                Keyword    type = meta.GetKeywordValue("navigationType");
                switch (type.Key.ToLower())
                {
                case "localizable":
                    res.NavType = NavigationType.Localizable;
                    break;
                }
                string navTextFields = meta.GetSingleFieldValue("navigationTextFieldPaths");
                if (!String.IsNullOrEmpty(navTextFields))
                {
                    res.NavTextFieldPaths = navTextFields.Split(',').Select(s => s.Trim()).ToList();
                }
                res.ExternalUrlTemplate = meta.GetSingleFieldValue("externalLinkTemplate");
            }
            return(res);
        }
コード例 #3
0
 private static NavigationConfig LoadConfig(Component component)
 {
     NavigationConfig res = new NavigationConfig {NavType = NavigationType.Simple};
     if (component.Metadata != null)
     {
         ItemFields meta = new ItemFields(component.Metadata, component.MetadataSchema);
         Keyword type = meta.GetKeywordValue("navigationType");
         switch (type.Key.ToLower())
         {
             case "localizable":
                 res.NavType = NavigationType.Localizable;
                 break;
         }
         string navTextFields = meta.GetSingleFieldValue("navigationTextFieldPaths");
         if (!String.IsNullOrEmpty(navTextFields))
         {
             res.NavTextFieldPaths = navTextFields.Split(',').Select(s => s.Trim()).ToList();
         }
         res.ExternalUrlTemplate = meta.GetSingleFieldValue("externalLinkTemplate");
     }
     return res;
 }
コード例 #4
0
        private static NavigationConfig GetNavigationConfiguration(Component navConfigComponent)
        {
            NavigationConfig result = new NavigationConfig { NavType = NavigationType.Simple };
            if (navConfigComponent.Metadata == null)
            {
                return result;
            }

            ItemFields navConfigComponentMetadataFields = new ItemFields(navConfigComponent.Metadata, navConfigComponent.MetadataSchema);
            Keyword type = navConfigComponentMetadataFields.GetKeywordValue("navigationType");
            switch (type.Key.ToLower())
            {
                case "localizable":
                    result.NavType = NavigationType.Localizable;
                    break;
            }
            string navTextFields = navConfigComponentMetadataFields.GetSingleFieldValue("navigationTextFieldPaths");
            if (!string.IsNullOrEmpty(navTextFields))
            {
                result.NavTextFieldPaths = navTextFields.Split(',').Select(s => s.Trim()).ToList();
            }
            result.ExternalUrlTemplate = navConfigComponentMetadataFields.GetSingleFieldValue("externalLinkTemplate");
            return result;
        }