protected virtual void OnTabSelected(object sender, UserTabSelectedEventArgs eventArgs) { if (Tab != null) { Tab.StatusChanged -= TabStatusChanged; } Tab = eventArgs.SelectedTab; Tab.StatusChanged += TabStatusChanged; TabStatusChanged(); }
public UserSection(UserEncounter encounter, Section data, SectionStatus status) { Encounter = encounter; Data = data; Status = status; foreach (var tab in data.Tabs) { var userTab = new UserTab(encounter, tab.Value, status.GetTabStatus(tab.Key)); userTab.StatusChanged += UpdateIsRead; Tabs.Add(tab.Key, userTab); } }
protected UserTab GetLastSequentialTabRead(UserSection section) { UserTab lastTab = null; foreach (var tab in section.Tabs.Values) { if (!tab.IsRead()) { return(lastTab); } lastTab = tab; } return(lastTab); }
protected virtual void OnTabSelected(object sender, UserTabSelectedEventArgs eventArgs) { if (CurrentTab == eventArgs.SelectedTab) { return; } CurrentTab = eventArgs.SelectedTab; if (TabCount == -1) { TabCount = NonImageContent.GetTabCount(); } Label.text = $"Page: {NonImageContent.GetCurrentTabNumber()}/{TabCount}"; }
protected SectionTabPair GetStartPoint(UserSection lastReadSection, UserSection firstUnreadSection) { UserTab tab = GetLastSequentialTabRead(firstUnreadSection); if (tab != null) { return(new SectionTabPair(firstUnreadSection, tab)); } if (lastReadSection == null || lastReadSection.Tabs.ValueArr.Length == 0) { return(null); } tab = lastReadSection.Tabs.ValueArr[lastReadSection.Tabs.ValueArr.Length - 1]; return(new SectionTabPair(lastReadSection, tab)); }
public virtual void Initialize(UserTab tab) => base.Display(this, new UserTabSelectedEventArgs(Tab = tab, ChangeType.JumpTo));
public SectionTabPair(UserSection section, UserTab tab) { Section = section; Tab = tab; }
public override void Initialize(UserTab tab) { base.Initialize(tab); Refresh(); }
public UserTabSelectedEventArgs(UserTab selectedTab, ChangeType changeType) { SelectedTab = selectedTab; ChangeType = changeType; }