Esempio n. 1
0
        protected internal override XElement ToXml(XNamespace ns)
        {
            var tmpId = (ElementId)Id;

            var element = new XElement(ns + ElementName
                                       , new XAttribute(tmpId.Type.ToString(), tmpId.Value)
                                       , new XAttribute("label", Label)
                                       , new XAttribute("size", size.ToString())
                                       , new XAttribute("showLabel", showLabel.ToString().ToLower())
                                       , new XAttribute("itemSize", itemSize.ToString())
                                       , imageVisible
                    ? string.IsNullOrEmpty(imageMso)
                        ? new XAttribute("image", imagePath)
                        : new XAttribute("imageMso", imageMso)
                    : new XAttribute("showImage", "false")
                                       , new XAttribute("getEnabled", "GetEnabled")
                                       , new XAttribute("getVisible", "GetVisible")
                                       , new XAttribute("tag", tmpId.Value)
                                       );

            if (!string.IsNullOrEmpty(screentip))
            {
                element.Add(new XAttribute("screentip", screentip));
            }

            if (!string.IsNullOrEmpty(supertip))
            {
                element.Add(new XAttribute("supertip", supertip));
            }

            if (!string.IsNullOrEmpty(keytip))
            {
                element.Add(new XAttribute("keytip", keytip));
            }

            if (!string.IsNullOrEmpty(description))
            {
                element.Add(new XAttribute("description", description));
            }

            if (((AddInList)controls)?.ToXml(ns) != null)
            {
                element.Add(((AddInList)controls).ToXml(ns));
            }

            return(element);
        }
Esempio n. 2
0
        protected internal override XElement ToXml(XNamespace ns)
        {
            var tmpId = (ElementId)Id;

            var element = new XElement(ns + ElementName
                                       , new XAttribute(tmpId.Type.ToString(), tmpId.Value)
                                       , new XAttribute("size", size.ToString())
                                       , new XAttribute("getEnabled", "GetEnabled")
                                       , new XAttribute("getVisible", "GetVisible")
                                       , new XAttribute("tag", tmpId.Value)
                                       );

            if (!string.IsNullOrEmpty(screentip))
            {
                element.Add(new XAttribute("screentip", screentip));
            }

            if (!string.IsNullOrEmpty(supertip))
            {
                element.Add(new XAttribute("supertip", supertip));
            }

            if (!string.IsNullOrEmpty(keytip))
            {
                element.Add(new XAttribute("keytip", keytip));
            }

            if (!string.IsNullOrEmpty(description))
            {
                element.Add(new XAttribute("description", description));
            }

            if (((AddInList)controls)?.ToXml(ns) != null)
            {
                element.Add(((AddInList)controls).ToXml(ns));
            }

            return(element);
        }
Esempio n. 3
0
        protected internal override XElement ToXml(XNamespace ns)
        {
            var tmpId = (ElementId)Id;

            var element = new XElement(ns + ElementName
                                       , new XAttribute(tmpId.Type.ToString(), tmpId.Value)
                                       , new XAttribute("label", Label)
                                       , new XAttribute("sizeString", new string('W', gallerySize))
                                       , new XAttribute("showLabel", showLabel.ToString().ToLower())
                                       , new XAttribute("showItemImage", showItemImage.ToString().ToLower())
                                       , new XAttribute("showItemLabel", showItemLabel.ToString().ToLower())
                                       , imageVisible
                    ? string.IsNullOrEmpty(imageMso)
                        ? new XAttribute("image", imagePath)
                        : new XAttribute("imageMso", imageMso)
                    : new XAttribute("showImage", "false")
                                       , new XAttribute("size", size.ToString())
                                       , new XAttribute("getEnabled", "GetEnabled")
                                       , new XAttribute("getVisible", "GetVisible")
                                       , new XAttribute("onAction", "OnActionDropDown")
                                       , new XAttribute("getSelectedItemIndex", "GetSelectedItemIndex")
                                       , new XAttribute("tag", tmpId.Value)
                                       );

            if (itemHeight > 0)
            {
                element.Add(new XAttribute("itemHeight", itemHeight));
            }

            if (itemWidth > 0)
            {
                element.Add(new XAttribute("itemWidth", itemWidth));
            }

            if (rows >= 0)
            {
                element.Add(new XAttribute("rows", rows));
            }

            if (cols >= 0)
            {
                element.Add(new XAttribute("columns", cols));
            }

            if (!string.IsNullOrEmpty(screentip))
            {
                element.Add(new XAttribute("screentip", screentip));
            }

            if (!string.IsNullOrEmpty(supertip))
            {
                element.Add(new XAttribute("supertip", supertip));
            }

            if (!string.IsNullOrEmpty(keytip))
            {
                element.Add(new XAttribute("keytip", keytip));
            }

            if (dynamicItemsLoading)
            {
                element.Add(new XAttribute("getItemCount", "GetItemCount")
                            , new XAttribute("getItemID", "GetItemId")
                            , new XAttribute("getItemImage", "GetItemImage")
                            , new XAttribute("getItemLabel", "GetItemLabel")
                            , new XAttribute("getItemScreentip", "GetItemScreentip")
                            , new XAttribute("getItemSupertip", "GetItemSupertip"));
            }
            else
            {
                // Add the Items first
                if (((AddInList)data)?.ToXml(ns) != null)
                {
                    element.Add(((AddInList)data).ToXml(ns));
                }
            }
            // Then the buttons
            if (((AddInList)controls)?.ToXml(ns) != null)
            {
                element.Add(((AddInList)controls).ToXml(ns));
            }

            return(element);
        }