DockGroupItem AddItemAtLocation(DockGroup grp, DockItem it, string location, bool visible, DockItemStatus status) { string[] positions = location.Split(';'); foreach (string pos in positions) { int i = pos.IndexOf('/'); if (i == -1) { continue; } string id = pos.Substring(0, i).Trim(); DockGroup g = grp.FindGroupContaining(id); if (g != null) { DockPosition dpos; try { dpos = (DockPosition)Enum.Parse(typeof(DockPosition), pos.Substring(i + 1).Trim(), true); } catch { continue; } DockGroupItem dgt = g.AddObject(it, dpos, id); dgt.SetVisible(visible); dgt.Status = status; return(dgt); } } return(null); }
DockGroupItem AddItemAtLocation (DockGroup grp, DockItem it, string location, bool visible, DockItemStatus status) { string[] positions = location.Split (';'); foreach (string pos in positions) { int i = pos.IndexOf ('/'); if (i == -1) continue; string id = pos.Substring (0,i).Trim (); DockGroup g = grp.FindGroupContaining (id); if (g != null) { DockPosition dpos; try { dpos = (DockPosition) Enum.Parse (typeof(DockPosition), pos.Substring(i+1).Trim(), true); } catch { continue; } DockGroupItem dgt = g.AddObject (it, dpos, id); dgt.SetVisible (visible); dgt.Status = status; return dgt; } } return null; }