Ejemplo n.º 1
0
        private Object LoadLinkedData(RQDescriptionElement descriptionElement, int subFieldIndex)
        {
            if (descriptionElement != null)
            {
                switch (descriptionElement.GetType().Name)
                {
                case "RQClassification":
                    RQClassification cl = (RQClassification)descriptionElement;

                    if (cl.items[subFieldIndex] != null)
                    {
                        RQLib.RQKos.Classifications.SubjClass sc = (RQLib.RQKos.Classifications.SubjClass)cl.items[subFieldIndex];

                        if (!cl.IsLinkedDataEnabled && !sc.IsComplete)
                        {
                            try
                            {
                                sc.EnableLinkedData();
                                sc.Load();
                                sc.DisableLinkedData();
                            }
                            catch {
                                sc.DisableLinkedData();
                            }
                        }
                        return(sc);
                    }
                    else
                    {
                        return(null);
                    }

                case "RQAuthors":
                    RQAuthors au = (RQAuthors)descriptionElement;

                    if (au.items[subFieldIndex] != null)
                    {
                        RQLib.RQKos.Persons.Person per = (RQLib.RQKos.Persons.Person)au.items[subFieldIndex];

                        if (!au.IsLinkedDataEnabled && !per.IsComplete)
                        {
                            per.EnableLinkedData();
                            per.Load();
                            per.DisableLinkedData();
                        }
                        return(per);
                    }
                    else
                    {
                        return(au.items[au.count - 1]);
                    }

                default:
                    return(null);
                }
            }
            return(null);
        }
Ejemplo n.º 2
0
        public void LoadLinkedData(string fieldName)
        {
            RQDescriptionElement de = GetDescriptionElement(fieldName);
            int count = 1;

            if (de.GetType().BaseType == typeof(RQArrayDescriptionElement))
            {
                count = ((RQArrayDescriptionElement)GetDescriptionElement(fieldName)).items.Count;
            }
            for (int i = 0; i < count; i++)
            {
                this.LoadLinkedData(de, i);
            }
        }
Ejemplo n.º 3
0
        public Object GetLinkedData(string fieldName, int subFieldIndex)
        {
            RQDescriptionElement de = this.GetDescriptionElement(fieldName);

            return(LoadLinkedData(de, subFieldIndex));
        }