当前位置: 首页>>代码示例>>C#>>正文


C# TagLib.CopyTo方法代码示例

本文整理汇总了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;
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:34,代码来源:EndTag.cs

示例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;
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:22,代码来源:StartTag.cs

示例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;
        }
开发者ID:sanyaade-embedded-systems,项目名称:MPTagThat,代码行数:52,代码来源:EndTag.cs

示例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;
        }
开发者ID:PacificACM,项目名称:aPlay,代码行数:44,代码来源:StartTag.cs


注:本文中的TagLib.CopyTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。