SobekCM.Core.Aggregations.Complete_Item_Aggregation.Add_Home_Page_File C# (CSharp) Method

Add_Home_Page_File() public method

Add the home page source file information, by language
public Add_Home_Page_File ( string Home_Page_File, Web_Language_Enum Language, bool isCustomHome ) : void
Home_Page_File string Home page text source file
Language Web_Language_Enum Language code
isCustomHome bool Flag indicates if this is a custom home page, which will /// override all other home page writing methods, and control the rendered page /// from the top to the bottom
return void
        public void Add_Home_Page_File(string Home_Page_File, Web_Language_Enum Language, bool isCustomHome )
        {
            if (Home_Page_File_Dictionary == null)
                Home_Page_File_Dictionary = new Dictionary<Web_Language_Enum, Complete_Item_Aggregation_Home_Page>();

            // If no language code, then always use this as the default
            if (Language == Web_Language_Enum.DEFAULT)
            {
                Home_Page_File_Dictionary[defaultUiLanguage] = new Complete_Item_Aggregation_Home_Page(Home_Page_File, isCustomHome, Language);
            }
            else
            {
                // Save this under the normalized language code
                Home_Page_File_Dictionary[Language] = new Complete_Item_Aggregation_Home_Page(Home_Page_File, isCustomHome, Language);
            }
        }

Usage Example

        private static void read_home(XmlNodeReader NodeReader, Complete_Item_Aggregation HierarchyObject)
        {
            while (NodeReader.Read())
            {
                // If this is the beginning tag for an element, assign the next values accordingly
                if (NodeReader.NodeType == XmlNodeType.Element)
                {
                    // Get the node name, trimmed and to upper
                    string nodeName = NodeReader.Name.Trim().ToUpper();

                    // switch the rest based on the tag name
                    switch (nodeName)
                    {
                        case "HI:BODY":
                            Web_Language_Enum langEnum = Web_Language_Enum.DEFAULT;
                            bool isCustom = false;
                            if ((NodeReader.HasAttributes) && (NodeReader.MoveToAttribute("lang")))
                            {
                                string bodyLanguage = NodeReader.GetAttribute("lang");
                                langEnum = Web_Language_Enum_Converter.Code_To_Enum(bodyLanguage);
                            }
                            if ((NodeReader.HasAttributes) && (NodeReader.MoveToAttribute("isCustom")))
                            {
                                string attribute = NodeReader.GetAttribute("isCustom");
                                if (attribute != null && attribute.ToLower() == "true")
                                    isCustom = true;
                            }

                            NodeReader.Read();
                            HierarchyObject.Add_Home_Page_File(NodeReader.Value, langEnum, isCustom );
                            break;
                    }
                }

                if ((NodeReader.NodeType == XmlNodeType.EndElement) && (NodeReader.Name.Trim().ToUpper() == "HI:HOME"))
                {
                    return;
                }
            }
        }
All Usage Examples Of SobekCM.Core.Aggregations.Complete_Item_Aggregation::Add_Home_Page_File