// public void Initialize(EditSession session) { prop = session.Property; ICollection valuesCollection = prop.Converter.GetStandardValues(); values = new TraceLab.Core.Components.EnumValue[valuesCollection.Count]; valuesCollection.CopyTo(values, 0); //values = System.Enum.GetValues (prop.PropertyType); Hashtable names = new Hashtable(); foreach (FieldInfo f in prop.PropertyType.GetFields()) { DescriptionAttribute att = (DescriptionAttribute)Attribute.GetCustomAttribute(f, typeof(DescriptionAttribute)); if (att != null) { names [f.Name] = att.Description; } else { names [f.Name] = f.Name; } } ebox = new Gtk.EventBox(); ebox.Show(); PackStart(ebox, true, true, 0); combo = Gtk.ComboBoxEntry.NewText(); combo.Changed += combo_Changed; combo.Entry.IsEditable = false; combo.Entry.CanFocus = false; combo.Entry.HasFrame = false; combo.Entry.HeightRequest = combo.SizeRequest().Height; combo.Show(); ebox.Add(combo); foreach (TraceLab.Core.Components.EnumValue value in values) { string str = prop.Converter.ConvertToString(value); if (names.Contains(str)) { str = (string)names [str]; } combo.AppendText(str); } }
public void Initialize (EditSession session) { values = DeployService.GetDeployDirectoryInfo (); ebox = new Gtk.EventBox (); ebox.Show (); PackStart (ebox, true, true, 0); combo = Gtk.ComboBoxEntry.NewText (); combo.Changed += combo_Changed; combo.Entry.IsEditable = false; combo.Entry.HasFrame = false; combo.Entry.HeightRequest = combo.SizeRequest ().Height; combo.Show (); ebox.Add (combo); foreach (DeployDirectoryInfo value in values) { combo.AppendText (value.Description); } }
public void Initialize(EditSession session) { values = DeployService.GetDeployDirectoryInfo(); ebox = new Gtk.EventBox(); ebox.Show(); PackStart(ebox, true, true, 0); combo = Gtk.ComboBoxEntry.NewText(); combo.Changed += combo_Changed; combo.Entry.IsEditable = false; combo.Entry.HasFrame = false; combo.Entry.HeightRequest = combo.SizeRequest().Height; combo.Show(); ebox.Add(combo); foreach (DeployDirectoryInfo value in values) { combo.AppendText(value.Description); } }
// public void Initialize (EditSession session) { prop = session.Property; ICollection valuesCollection = prop.Converter.GetStandardValues(); values = new TraceLab.Core.Components.EnumValue[valuesCollection.Count]; valuesCollection.CopyTo(values, 0); //values = System.Enum.GetValues (prop.PropertyType); Hashtable names = new Hashtable (); foreach (FieldInfo f in prop.PropertyType.GetFields ()) { DescriptionAttribute att = (DescriptionAttribute) Attribute.GetCustomAttribute (f, typeof(DescriptionAttribute)); if (att != null) names [f.Name] = att.Description; else names [f.Name] = f.Name; } ebox = new Gtk.EventBox (); ebox.Show (); PackStart (ebox, true, true, 0); combo = Gtk.ComboBoxEntry.NewText (); combo.Changed += combo_Changed; combo.Entry.IsEditable = false; combo.Entry.CanFocus = false; combo.Entry.HasFrame = false; combo.Entry.HeightRequest = combo.SizeRequest ().Height; combo.Show (); ebox.Add (combo); foreach (TraceLab.Core.Components.EnumValue value in values) { string str = prop.Converter.ConvertToString (value); if (names.Contains (str)) str = (string) names [str]; combo.AppendText (str); } }