void AddSource(ProjectIconSource source) { string size = source.SizeWildcarded ? sizes[0] : source.Size.ToString(); string state = source.StateWildcarded ? states[0] : source.State.ToString(); string dir = source.DirectionWildcarded ? directions[0] : source.Direction.ToString(); sourceListStore.AppendValues(source.Image.GetThumbnail(project, 16), source.Image.Label, size, state, dir, source.Image); }
protected void OnAddSource(object s, EventArgs args) { using (SelectImageDialog dlg = new SelectImageDialog(dialog, project)) { if (dlg.Run() == (int)Gtk.ResponseType.Ok) { ProjectIconSource src = new ProjectIconSource(); src.Image = dlg.Icon; src.AllWildcarded = true; AddSource(src); UpdateButtons(); } } }
ProjectIconSource GetSource(Gtk.TreeIter iter) { ProjectIconSource src = new ProjectIconSource(); src.Image = (ImageInfo)sourceListStore.GetValue(iter, 5); string s = (string)sourceListStore.GetValue(iter, 2); if (s == sizes[0]) { src.SizeWildcarded = true; } else { src.SizeWildcarded = false; src.Size = (Gtk.IconSize)Enum.Parse(typeof(Gtk.IconSize), s); } s = (string)sourceListStore.GetValue(iter, 3); if (s == states[0]) { src.StateWildcarded = true; } else { src.StateWildcarded = false; src.State = (Gtk.StateType)Enum.Parse(typeof(Gtk.StateType), s); } s = (string)sourceListStore.GetValue(iter, 4); if (s == directions[0]) { src.DirectionWildcarded = true; } else { src.DirectionWildcarded = false; src.Direction = (Gtk.TextDirection)Enum.Parse(typeof(Gtk.TextDirection), s); } return(src); }
void Save() { iconSet.Name = nameEntry.Text; iconSet.Sources.Clear(); if (radioSingle.Active) { ProjectIconSource src = new ProjectIconSource(); src.AllWildcarded = true; src.Image = singleIcon; iconSet.Sources.Add(src); } else { Gtk.TreeIter iter; if (sourceListStore.GetIterFirst(out iter)) { do { iconSet.Sources.Add(GetSource(iter)); }while (sourceListStore.IterNext(ref iter)); } } }
void Save() { iconSet.Name = nameEntry.Text; iconSet.Sources.Clear (); if (radioSingle.Active) { ProjectIconSource src = new ProjectIconSource (); src.AllWildcarded = true; src.Image = singleIcon; iconSet.Sources.Add (src); } else { Gtk.TreeIter iter; if (sourceListStore.GetIterFirst (out iter)) { do { iconSet.Sources.Add (GetSource (iter)); } while (sourceListStore.IterNext (ref iter)); } } }
ProjectIconSource GetSource(Gtk.TreeIter iter) { ProjectIconSource src = new ProjectIconSource (); src.Image = (ImageInfo) sourceListStore.GetValue (iter, 5); string s = (string) sourceListStore.GetValue (iter, 2); if (s == sizes[0]) src.SizeWildcarded = true; else { src.SizeWildcarded = false; src.Size = (Gtk.IconSize) Enum.Parse (typeof(Gtk.IconSize), s); } s = (string) sourceListStore.GetValue (iter, 3); if (s == states[0]) src.StateWildcarded = true; else { src.StateWildcarded = false; src.State = (Gtk.StateType) Enum.Parse (typeof(Gtk.StateType), s); } s = (string) sourceListStore.GetValue (iter, 4); if (s == directions[0]) src.DirectionWildcarded = true; else { src.DirectionWildcarded = false; src.Direction = (Gtk.TextDirection) Enum.Parse (typeof(Gtk.TextDirection), s); } return src; }
void AddSource(ProjectIconSource source) { string size = source.SizeWildcarded ? sizes[0] : source.Size.ToString (); string state = source.StateWildcarded ? states[0] : source.State.ToString (); string dir = source.DirectionWildcarded ? directions[0] : source.Direction.ToString (); sourceListStore.AppendValues (source.Image.GetThumbnail (project, 16), source.Image.Label, size, state, dir, source.Image); }
protected void OnAddSource(object s, EventArgs args) { using (SelectImageDialog dlg = new SelectImageDialog (dialog, project)) { if (dlg.Run () == (int) Gtk.ResponseType.Ok) { ProjectIconSource src = new ProjectIconSource (); src.Image = dlg.Icon; src.AllWildcarded = true; AddSource (src); UpdateButtons (); } } }