示例#1
0
        public TabPage GetPageContainingControl(OPMBaseControl contents)
        {
            if (this.TabPages != null && this.TabPages.Count > 0)
            {
                foreach (TabPage tp in this.TabPages)
                {
                    if (tp.Controls != null && tp.Controls.Contains(contents))
                        return tp;
                }
            }

            return null;
        }
        public TabPage GetPageContainingControl(OPMBaseControl contents)
        {
            if (this.TabPages != null && this.TabPages.Count > 0)
            {
                foreach (TabPage tp in this.TabPages)
                {
                    if (tp.Controls != null && tp.Controls.Contains(contents))
                    {
                        return(tp);
                    }
                }
            }

            return(null);
        }
示例#3
0
        private int FindIndexForInsert(OPMBaseControl screen)
        {
            int idx = 0;

            if (screen == PlaylistScreen)
            {
                idx = 0; // Playlist always goes first
            }
            else
            {
                TabPage tpPlaylist = GetPageContainingControl(PlaylistScreen);
                TabPage tpTrackInfo = GetPageContainingControl(TrackInfoScreen);

                if (screen == TrackInfoScreen)
                {
                    if (tpPlaylist != null)
                        idx = 1; // If playlist is shown, Track Info goes in second place
                    else
                        idx = 0; // Otherwise it goes first
                }
                else if (screen == SignalAnalysisScreen)
                {
                    if (tpTrackInfo != null &&
                        tpPlaylist != null)
                        idx = 2; // If both playlist and track info are shown, Signal Analisys goes in third place

                    else if (tpTrackInfo != null || tpPlaylist != null)
                        idx = 1; // If one of playlist and track info is shown (bit no both), Signal Analisys goes in second place

                    else
                        idx = 0; // Otherwise it goes first
                }
                else if (screen == BookmarkScreen)
                    idx = (TabPages.Count); // Bookmark Info always goes last
            }

            return idx;
        }