コード例 #1
0
        /// <summary>
        /// Initializes tabs by given tab order (adding tabs to TabControl, binding with Log9KTabs)
        /// </summary>
        /// <param name="types"></param>
        private void InitTabs(Log9KCore.LogEntryType[] types)
        {
            /* Creating tabs for predefined types, custom types */
            Log9KTabAll tabAll = (Log9KTabAll)_log9KCore.Log9KTabsDictionary[Log9KCore.ALL_LOG_TAB_S];

            AddTab(tabAll);

            /* Generate list of strings, which are names of tabs*/
            List <string> logEntryTypeStrings;

            if (types == null)
            {
                logEntryTypeStrings = new List <string>(Enum.GetNames(typeof(Log9KCore.LogEntryType)));
            }
            else
            {
                logEntryTypeStrings = new List <string>();
                foreach (Log9KCore.LogEntryType t in types)
                {
                    logEntryTypeStrings.Add(t.ToString());
                }
            }
            /* Adding list of custom types to tab names */
            logEntryTypeStrings.AddRange(_log9KCore.CustomTypesList);

            foreach (string logEntryType in logEntryTypeStrings)
            {
                if (logEntryType == Log9KCore.LogEntryType.CUSTOM.ToString() || logEntryType == Log9KCore.ALL_LOG_TAB_S)
                {
                    continue;
                }
                Log9KTab currentTab = _log9KCore.Log9KTabsDictionary[logEntryType];
                AddTab(currentTab);
            }
        }
コード例 #2
0
        /// <summary>
        /// Init and fill core's collection of tabs
        /// </summary>
        private void InitTabs()
        {
            IEnumerable <TabTypes> tabTypes = Log9KUtil.EnumUtil.GetValues <TabTypes>();

            foreach (TabTypes type in tabTypes)
            {
                switch (type)
                {
                case TabTypes.CUSTOM: {
                    continue;
                }

                case TabTypes.ALL: {
                    TabAll = new Log9KTabAll();
                    AddNewTab(TabTypes.ALL, TabAll);
                    break;
                }

                default: {
                    AddNewTab(type, new Log9KTab(type));
                    break;
                }
                }
            }
            AddNewTab(INNER_LOG_TAB, new Log9KTab(INNER_LOG_TAB));
        }