本文整理汇总了C#中TagLib.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# TagLib.CopyTo方法的具体用法?C# TagLib.CopyTo怎么用?C# TagLib.CopyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TagLib
的用法示例。
在下文中一共展示了TagLib.CopyTo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddTag
public TagLib.Tag AddTag(TagTypes type, TagLib.Tag copy)
{
TagLib.Tag target = null;
if (type == (TagTypes.None | TagTypes.Id3v1))
{
target = new TagLib.Id3v1.Tag();
}
else if (type == (TagTypes.None | TagTypes.Id3v2))
{
TagLib.Id3v2.Tag tag2;
target = new TagLib.Id3v2.Tag {
Version = 4,
Flags = (byte) (tag2.Flags | HeaderFlags.FooterPresent)
};
}
else if (type == (TagTypes.None | TagTypes.Ape))
{
target = new TagLib.Ape.Tag();
}
if (target != null)
{
if (copy != null)
{
copy.CopyTo(target, true);
}
if (type == (TagTypes.None | TagTypes.Id3v1))
{
base.AddTag(target);
return target;
}
base.InsertTag(0, target);
}
return target;
}
示例2: AddTag
public TagLib.Tag AddTag(TagTypes type, TagLib.Tag copy)
{
TagLib.Tag target = null;
if (type == (TagTypes.None | TagTypes.Id3v2))
{
target = new TagLib.Id3v2.Tag();
}
else if (type == (TagTypes.None | TagTypes.Ape))
{
target = new TagLib.Ape.Tag();
(target as TagLib.Ape.Tag).HeaderPresent = true;
}
if (target != null)
{
if (copy != null)
{
copy.CopyTo(target, true);
}
base.AddTag(target);
}
return target;
}
示例3: AddTag
/// <summary>
/// Adds a tag of a specified type to the current instance,
/// optionally copying values from an existing type.
/// </summary>
/// <param name="type">
/// A <see cref="TagTypes" /> value specifying the type of
/// tag to add to the current instance. At the time of this
/// writing, this is limited to <see cref="TagTypes.Ape" />,
/// <see cref="TagTypes.Id3v1" />, and <see
/// cref="TagTypes.Id3v2" />.
/// </param>
/// <param name="copy">
/// A <see cref="TagLib.Tag" /> to copy values from using
/// <see cref="TagLib.Tag.CopyTo" />, or <see
/// langword="null" /> if no tag is to be copied.
/// </param>
/// <returns>
/// The <see cref="TagLib.Tag" /> object added to the current
/// instance, or <see langword="null" /> if it couldn't be
/// created.
/// </returns>
/// <remarks>
/// ID3v2 tags are added at the end of the current instance,
/// while other tags are added to the beginning.
/// </remarks>
public TagLib.Tag AddTag(TagTypes type, TagLib.Tag copy)
{
TagLib.Tag tag = null;
if (type == TagTypes.Id3v1) {
tag = new TagLib.Id3v1.Tag ();
} else if (type == TagTypes.Id3v2) {
Id3v2.Tag tag32 = new Id3v2.Tag ();
tag32.Version = 4;
tag32.Flags |= Id3v2.HeaderFlags.FooterPresent;
tag = tag32;
} else if (type == TagTypes.Ape) {
tag = new TagLib.Ape.Tag ();
}
if (tag != null) {
if (copy != null)
copy.CopyTo (tag, true);
if (type == TagTypes.Id3v1)
AddTag (tag);
else
InsertTag (0, tag);
}
return tag;
}
示例4: AddTag
/// <summary>
/// Adds a tag of a specified type to the current instance,
/// optionally copying values from an existing type.
/// </summary>
/// <param name="type">
/// A <see cref="TagTypes" /> value specifying the type of
/// tag to add to the current instance. At the time of this
/// writing, this is limited to <see cref="TagTypes.Ape" />
/// and <see cref="TagTypes.Id3v2" />.
/// </param>
/// <param name="copy">
/// A <see cref="TagLib.Tag" /> to copy values from using
/// <see cref="TagLib.Tag.CopyTo" />, or <see
/// langword="null" /> if no tag is to be copied.
/// </param>
/// <returns>
/// The <see cref="TagLib.Tag" /> object added to the current
/// instance, or <see langword="null" /> if it couldn't be
/// created.
/// </returns>
/// <remarks>
/// ID3v2 tags are added at the end of the current instance,
/// while other tags are added to the beginning.
/// </remarks>
public TagLib.Tag AddTag(TagTypes type, TagLib.Tag copy)
{
TagLib.Tag tag = null;
if (type == TagTypes.Id3v2) {
tag = new TagLib.Id3v2.Tag ();
} else if (type == TagTypes.Ape) {
tag = new TagLib.Ape.Tag ();
(tag as Ape.Tag).HeaderPresent = true;
}
if (tag != null) {
if (copy != null)
copy.CopyTo (tag, true);
AddTag (tag);
}
return tag;
}