public int?OpenNewTab(dnObject obj) { int id = GetNewVarID(); m_ID2Item.Add(id, new TabItem(obj, true)); return(id); }
public bool ContainObject(dnObject obj) { foreach (var pair in m_ID2Item) { if (pair.Value.obj == obj) { return(true); } } return(false); }
public int?OpenTab(dnObject obj) { if (ContainObject(obj)) { return(null); } else { return(OpenNewTab(obj)); } }
protected virtual void ProcessSelectTab(int tabID, dnObject obj) { if (tabID != m_PrevSelectID) { if (m_PrevSelectID != null) { NotifyTabEvent(ETabEvent.Close, m_PrevSelectID.Value, m_ID2Item[m_PrevSelectID.Value].obj); } NotifyTabEvent(ETabEvent.Open, tabID, obj); } m_PrevSelectID = tabID; }
/// <summary> /// Tab Event /// </summary> protected virtual void NotifyTabEvent(ETabEvent eTabEvent, int tabID, dnObject obj) { Logger.Info(eTabEvent + " Tab Actoin:" + obj.Name); OnTabEvent?.Invoke(eTabEvent, obj); }
public TabItem(dnObject obj, bool state) { this.obj = obj; this.state = state; }
public diObjectTB(dnObject obj) { m_Object = obj; }