示例#1
0
        protected override void ReadProperties(ObjectReader reader, XmlElement elem)
        {
            if (reader.Format == FileFormat.Glade)
            {
                string file     = (string)GladeUtils.ExtractProperty(elem, "pixbuf", "");
                string stock    = (string)GladeUtils.ExtractProperty(elem, "stock", "");
                string iconSize = (string)GladeUtils.ExtractProperty(elem, "icon_size", "");
                base.ReadProperties(reader, elem);

                if (stock != null && stock.Length > 0)
                {
                    Pixbuf = ImageInfo.FromTheme(stock, (Gtk.IconSize) int.Parse(iconSize));
                }
                else if (file != null && file != "")
                {
                    Pixbuf = ImageInfo.FromFile(file);
                }
            }
            else
            {
                base.ReadProperties(reader, elem);
            }
        }