コード例 #1
0
ファイル: EnvyBook.cs プロジェクト: sahwar/Envy
		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("  ", " ");
		}
コード例 #2
0
ファイル: ShareazaBook.cs プロジェクト: nlstone/Shareaza
        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("  ", " ");
        }