Exemplo n.º 1
0
        static void AddServiceItem(ServiceItem serviceItem)
        {
            serviceItems.Add(serviceItem);
            int index;

            foreach (string subject in serviceItem.SupportedSubjects)
            {
                index = subjects.BinarySearch(subject);
                if (index < 0)
                {
                    subjects.Insert(~index, subject);
                }
            }
        }
Exemplo n.º 2
0
        public override SubjectCollection GetSupportedSubjects()
        {
            SubjectCollection subjects = new SubjectCollection();
            int index;

            foreach (ServiceItemData sid in services)
            {
                index = subjects.BinarySearch(sid.Subject);
                if (index < 0)
                {
                    subjects.Insert(~index, sid.Subject);
                }
            }
            return(subjects);
        }
Exemplo n.º 3
0
        public override SubjectCollection GetSupportedSubjects()
        {
            if (!disabledLanguagesAlreadySet)
            {
                return(Manager.Subjects);
            }
            else
            {
                PrepareProcessing();
                SubjectCollection subjects = new SubjectCollection();
                int index;
                foreach (ServiceItem item in Manager.ServiceItems)
                {
                    foreach (LanguagePair lp in item.SupportedTranslations)
                    {
                        if (disabledSourceLanguages.BinarySearch(lp.From) >= 0)
                        {
                            continue;
                        }

                        if (disabledTargetLanguages.BinarySearch(lp.To) >= 0)
                        {
                            continue;
                        }

                        foreach (string subject in item.SupportedSubjects)
                        {
                            index = subjects.BinarySearch(subject);
                            if (index < 0)
                            {
                                subjects.Insert(~index, subject);
                            }
                        }

                        break;
                    }
                }
                return(subjects);
            }
        }
        public override SubjectCollection GetSupportedSubjects()
        {
            if(!disabledLanguagesAlreadySet)
                return Manager.Subjects;
            else
            {
                PrepareProcessing();
                SubjectCollection subjects = new SubjectCollection();
                int index;
                foreach(ServiceItem item in Manager.ServiceItems)
                {
                    foreach(LanguagePair lp in item.SupportedTranslations)
                    {
                        if(disabledSourceLanguages.BinarySearch(lp.From) >= 0)
                            continue;

                        if(disabledTargetLanguages.BinarySearch(lp.To) >= 0)
                            continue;

                        foreach(string subject in item.SupportedSubjects)
                        {
                            index = subjects.BinarySearch(subject);
                            if(index < 0)
                                subjects.Insert(~index,subject);
                        }

                        break;
                    }
                }
                return subjects;
            }
        }