Func<object> BuildArgumentEntry(Argument a)
        {
            Label lbl = new Label ();
            Entry ety = new Entry ();

            DType t = Mapper.DTypeFromString(a.Type);

            lbl.Text = string.Format ("{0} ({1}) : ", a.Name, Mapper.DTypeToStr (t));
            lbl.Xalign = 0;

            argumentTable.Attach (lbl, 0, 1, rowIndex, rowIndex + 1);
            argumentTable.Attach (ety, 1, 2, rowIndex, rowIndex + 1);
            rowIndex++;

            lbl.Show ();
            ety.Show ();
            argumentTable.ShowAll ();

            return (Func<object>)delegate {
                object result = Mapper.Convert(t, ety.Text);

                return result;
            };
        }
Example #2
0
        IElement ParseProperty(XmlReader property)
        {
            if (property == null)
                return null;

            property.Read();
            string name = property["name"];
            Argument type = new Argument(property["type"], null);
            PropertyAccess access = PropertyAccess.Read;
            switch (property["access"]) {
                case "readwrite":
                    access = PropertyAccess.ReadWrite;
                    break;
                case "read":
                    access = PropertyAccess.Read;
                    break;
                case "write":
                    access = PropertyAccess.Write;
                    break;
            }

            property.Close();

            return elementFactory.FromPropertyDefinition(name, type.Type, access);
        }