示例#1
0
        private string getEventCategory(string title, string description, int contentType, int contentSubType)
        {
            if (contentType == -1 || contentSubType == -1)
            {
                return(getCustomCategory(title, description));
            }

            if (contentType == 0 && contentSubType == 0)
            {
                return(getCustomCategory(title, description));
            }

            if (contentType == 0 && contentSubType == 255)
            {
                return(getCustomCategory(title, description));
            }

            if (RunParameters.Instance.Options.Contains("CUSTOMCATEGORYOVERRIDE"))
            {
                string customCategory = getCustomCategory(title, description);
                if (customCategory != null)
                {
                    return(customCategory);
                }
            }

            BellTVProgramCategory mainCategoryEntry = BellTVProgramCategory.FindCategory(contentType, 0);

            if (mainCategoryEntry == null)
            {
                BellTVProgramCategory.AddUndefinedCategory(contentType, 0, "", title);

                if (RunParameters.Instance.Options.Contains("CUSTOMCATEGORYOVERRIDE"))
                {
                    return(null);
                }

                return(getCustomCategory(title, description));
            }

            if (mainCategoryEntry.SampleEvent == null)
            {
                mainCategoryEntry.SampleEvent = title;
            }
            mainCategoryEntry.UsedCount++;
            return(mainCategoryEntry.Description);
        }