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

Add_Web_Skin() public method

Add a web skin which this aggregation can appear under
public Add_Web_Skin ( string Web_Skin ) : void
Web_Skin string Web skin this can appear under
return void
        public void Add_Web_Skin(string Web_Skin)
        {
            if (Web_Skins == null) Web_Skins = new List<string>();

            Web_Skins.Add(Web_Skin);
            if ( String.IsNullOrEmpty(Default_Skin))
                Default_Skin = Web_Skin;
        }

Usage Example

        private static void read_settings(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:WEBSKINS":
                            NodeReader.Read();
                            string webskins = NodeReader.Value;
                            string[] splitter = webskins.Split(",".ToCharArray());
                            foreach (string thisSplitter in splitter)
                            {
                                if ( thisSplitter.Length > 0 )
                                    HierarchyObject.Add_Web_Skin(thisSplitter.ToLower());
                            }
                            break;

                        case "HI:CSS":
                            NodeReader.Read();
                            HierarchyObject.CSS_File = NodeReader.Value.Trim();
                            break;

                        case "HI:CUSTOMHOME":
                            NodeReader.Read();
                            // No longer do anything with this tag
                            // HierarchyObject.Custom_Home_Page_Source_File = NodeReader.Value.Trim();
                            break;

                        case "HI:FACETS":
                            NodeReader.Read();
                            string facets = NodeReader.Value;
                            string[] splitter2 = facets.Split(",".ToCharArray());
                            HierarchyObject.Clear_Facets();
                            foreach (string thisSplitter2 in splitter2)
                            {
                                    HierarchyObject.Add_Facet(Convert.ToInt16(thisSplitter2));
                            }
                            break;

                        case "HI:MAPSEARCH":
                            if (NodeReader.MoveToAttribute("type"))
                            {
                                switch (NodeReader.GetAttribute("type").ToLower())
                                {
                                    case "extent":
                                    case "computed":
                                        // This should already be set, assuming there were values to be added
                                        if (HierarchyObject.Map_Search_Display == null)
                                        {
                                            HierarchyObject.Map_Search_Display = new Item_Aggregation_Map_Coverage_Info(Item_Aggregation_Map_Coverage_Type_Enum.COMPUTED);
                                        }
                                        break;

                                    case "fixed":
                                        decimal latitude = 999;
                                        decimal longitude = 999;
                                        int zoom = 999;

                                        if (NodeReader.MoveToAttribute("latitude"))
                                        {
                                            Decimal.TryParse(NodeReader.GetAttribute("latitude"), out latitude);
                                        }
                                        if (NodeReader.MoveToAttribute("longitude"))
                                        {
                                            Decimal.TryParse(NodeReader.GetAttribute("longitude"), out longitude);
                                        }
                                        if (NodeReader.MoveToAttribute("zoom"))
                                        {
                                            Int32.TryParse(NodeReader.GetAttribute("zoom"), out zoom);
                                        }

                                        if ((latitude != 999) && (longitude != 999))
                                        {
                                            HierarchyObject.Map_Search_Display = new Item_Aggregation_Map_Coverage_Info(Item_Aggregation_Map_Coverage_Type_Enum.FIXED, zoom, longitude, latitude );
                                        }
                                        break;
                                }
                            }
                            break;

                        case "HI:MAPBROWSE":
                            if (NodeReader.MoveToAttribute("type"))
                            {
                                switch (NodeReader.GetAttribute("type").ToLower())
                                {
                                    case "extent":
                                        HierarchyObject.Map_Browse_Display = new Item_Aggregation_Map_Coverage_Info(Item_Aggregation_Map_Coverage_Type_Enum.EXTENT);
                                        break;

                                    case "computed":
                                        HierarchyObject.Map_Browse_Display = new Item_Aggregation_Map_Coverage_Info(Item_Aggregation_Map_Coverage_Type_Enum.COMPUTED);
                                        break;

                                    case "fixed":
                                        decimal latitude = 999;
                                        decimal longitude = 999;
                                        int zoom = 999;

                                        if (NodeReader.MoveToAttribute("latitude"))
                                        {
                                            Decimal.TryParse(NodeReader.GetAttribute("latitude"), out latitude);
                                        }
                                        if (NodeReader.MoveToAttribute("longitude"))
                                        {
                                            Decimal.TryParse(NodeReader.GetAttribute("longitude"), out longitude);
                                        }
                                        if (NodeReader.MoveToAttribute("zoom"))
                                        {
                                            Int32.TryParse(NodeReader.GetAttribute("zoom"), out zoom);
                                        }

                                        if ((latitude != 999) && (longitude != 999))
                                        {
                                            HierarchyObject.Map_Browse_Display = new Item_Aggregation_Map_Coverage_Info(Item_Aggregation_Map_Coverage_Type_Enum.FIXED, zoom, longitude, latitude);
                                        }
                                        break;
                                }
                            }
                            break;

                    }
                }

                if (NodeReader.NodeType == XmlNodeType.EndElement)
                {
                    if (NodeReader.Name.Trim().ToUpper() == "HI:SETTINGS")
                    {
                        return;
                    }
                }
            }
        }