SobekCM.Resource_Object.Bib_Info.Name_Info.Add_MODS C# (CSharp) Метод

Add_MODS() приватный Метод

Writes this location as MODS to a writer writing to a stream ( either a file or web response stream )
private Add_MODS ( bool MainEntityFlag, TextWriter ReturnValue ) : void
MainEntityFlag bool Flag indicates if this is the main entity / primary author associated with a digital resource
ReturnValue System.IO.TextWriter Writer to the MODS building stream
Результат void
        internal void Add_MODS(bool MainEntityFlag, TextWriter ReturnValue)
        {
            ReturnValue.Write("<mods:name");
            switch (name_type)
            {
                case Name_Info_Type_Enum.Personal:
                    ReturnValue.Write(" type=\"personal\"");
                    break;

                case Name_Info_Type_Enum.Conference:
                    ReturnValue.Write(" type=\"conference\"");
                    break;

                case Name_Info_Type_Enum.Corporate:
                    ReturnValue.Write(" type=\"corporate\"");
                    break;
            }
            Add_ID(ReturnValue);
            ReturnValue.Write(">\r\n");

            if (!String.IsNullOrEmpty(full_name))
            {
                ReturnValue.Write("<mods:namePart>" + Convert_String_To_XML_Safe(full_name) + "</mods:namePart>\r\n");
            }

            if (!String.IsNullOrEmpty(given_name))
            {
                ReturnValue.Write("<mods:namePart type=\"given\">" + Convert_String_To_XML_Safe(given_name) + "</mods:namePart>\r\n");
            }

            if (!String.IsNullOrEmpty(family_name))
            {
                ReturnValue.Write("<mods:namePart type=\"family\">" + Convert_String_To_XML_Safe(family_name) + "</mods:namePart>\r\n");
            }

            if (!String.IsNullOrEmpty(dates))
            {
                ReturnValue.Write("<mods:namePart type=\"date\">" + Convert_String_To_XML_Safe(dates) + "</mods:namePart>\r\n");
            }

            if (!String.IsNullOrEmpty(terms_of_address))
            {
                ReturnValue.Write("<mods:namePart type=\"termsOfAddress\">" + Convert_String_To_XML_Safe(terms_of_address) + "</mods:namePart>\r\n");
            }

            if (!String.IsNullOrEmpty(display_form))
            {
                ReturnValue.Write("<mods:displayForm>" + Convert_String_To_XML_Safe(display_form) + "</mods:displayForm>\r\n");
            }

            if (!String.IsNullOrEmpty(affiliation))
            {
                ReturnValue.Write("<mods:affiliation>" + Convert_String_To_XML_Safe(affiliation) + "</mods:affiliation>\r\n");
            }

            if (!String.IsNullOrEmpty(description))
            {
                ReturnValue.Write("<mods:description>" + Convert_String_To_XML_Safe(description) + "</mods:description>\r\n");
            }

            if (((Roles != null) && (Roles.Count > 0)) || (MainEntityFlag))
            {
                ReturnValue.Write("<mods:role>\r\n");
                if (MainEntityFlag)
                {
                    ReturnValue.Write("<mods:roleTerm>Main Entity</mods:roleTerm>\r\n");
                }
                if (Roles != null)
                {
                    foreach (Name_Info_Role thisRole in Roles)
                    {
                        ReturnValue.Write("<mods:roleTerm");
                        switch (thisRole.Role_Type)
                        {
                            case Name_Info_Role_Type_Enum.Code:
                                ReturnValue.Write(" type=\"code\"");
                                break;

                            case Name_Info_Role_Type_Enum.Text:
                                ReturnValue.Write(" type=\"text\"");
                                break;
                        }
                        if (thisRole.Authority.Length > 0)
                        {
                            ReturnValue.Write(" authority=\"" + thisRole.Authority + "\"");
                        }

                        ReturnValue.Write(">" + Convert_String_To_XML_Safe(thisRole.Role) + "</mods:roleTerm>\r\n");
                    }
                }
                ReturnValue.Write("</mods:role>\r\n");
            }

            ReturnValue.Write("</mods:name>\r\n");
        }