Example #1
0
		private string GetAuthor(AuthorType author) {
			string[] names = new string[3];

			for (int i = 0; i < author.ItemsElementName.Length; i++) {
				// Should we check the lang field ?
				if (author.ItemsElementName[i] == AuthorDataChoice.firstname) {
					names[0] = (string)((TextFieldType)author.Items[i]).Value;
				} else if (author.ItemsElementName[i] == AuthorDataChoice.middlename) {
					names[1] = (string)((TextFieldType)author.Items[i]).Value;
				} else if (author.ItemsElementName[i] == AuthorDataChoice.lastname) {
					names[2] = (string)((TextFieldType)author.Items[i]).Value;
				}
			}

			return String.Join(" ", names).Replace("  ", " ");
		}
Example #2
0
        private string GetAuthor(AuthorType author)
        {
            string[] names = new string[3];

            for (int i = 0; i < author.ItemsElementName.Length; i++) {
                // Should we check the lang field ?
                if (author.ItemsElementName[i] == AuthorDataChoice.firstname) {
                    names[0] = (string)((TextFieldType)author.Items[i]).Value;
                } else if (author.ItemsElementName[i] == AuthorDataChoice.middlename) {
                    names[1] = (string)((TextFieldType)author.Items[i]).Value;
                } else if (author.ItemsElementName[i] == AuthorDataChoice.lastname) {
                    names[2] = (string)((TextFieldType)author.Items[i]).Value;
                }
            }

            return String.Join(" ", names).Replace("  ", " ");
        }