本文整理汇总了C#中Tag.AddTitle方法的典型用法代码示例。如果您正苦于以下问题:C# Tag.AddTitle方法的具体用法?C# Tag.AddTitle怎么用?C# Tag.AddTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tag
的用法示例。
在下文中一共展示了Tag.AddTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public Tag Read(Stream fs, TrackerFormat format)
{
Tag tag = new Tag();
int start_offset = 0;
int end_offset = 0;
string sig = null;
switch (format) {
case TrackerFormat.S3m:
end_offset = 28;
break;
case TrackerFormat.Mod:
end_offset = 20;
break;
case TrackerFormat.Xm:
start_offset = 17;
end_offset = 20;
break;
case TrackerFormat.It:
sig = "IMPM";
end_offset = 26;
break;
}
//Parse the tag -)------------------------------------------------
fs.Seek(start_offset, SeekOrigin.Begin);
byte[] b;
if (sig != null) {
b = new byte[sig.Length];
fs.Read(b, 0, sig.Length);
if (Encoding.ASCII.GetString(b) != sig)
return tag;
}
b = new byte[end_offset];
fs.Read(b, 0, end_offset);
string content = Encoding.ASCII.GetString(b, 0, end_offset);
int term = content.IndexOf('\0');
if (term == -1)
term = end_offset;
content = content.Substring(0, term).Trim();
tag.AddTitle(content);
return tag;
}
示例2: CombineTags
public static Tag CombineTags(params Tag [] tags)
{
Tag ret = new Tag();
foreach(Tag tag in tags) {
if(tag == null) {
continue;
}
foreach(TagTextField artist in tag.Artist) {
ret.AddArtist (artist.Content);
}
foreach(TagTextField album in tag.Album) {
ret.AddAlbum(album.Content);
}
foreach(TagTextField title in tag.Title) {
ret.AddTitle(title.Content);
}
foreach(TagTextField track in tag.Track) {
ret.AddTrack(track.Content);
}
foreach(TagTextField trackcount in tag.TrackCount) {
ret.AddTrackCount(trackcount.Content);
}
foreach(TagTextField year in tag.Year) {
ret.AddYear(year.Content);
}
foreach(TagTextField comment in tag.Comment) {
ret.AddComment(comment.Content);
}
foreach(TagTextField license in tag.License) {
ret.AddLicense(license.Content);
}
foreach(TagTextField genre in tag.Genre) {
ret.AddGenre(genre.Content);
}
}
return ret;
}