• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TagTypes类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TagTypes的典型用法代码示例。如果您正苦于以下问题:C# TagTypes类的具体用法?C# TagTypes怎么用?C# TagTypes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TagTypes类属于命名空间,在下文中一共展示了TagTypes类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: TagLibReaderWriterBase

		public TagLibReaderWriterBase(
			string witnessFileName,
			TagTypes tagTypes)
		{
			_witnessFilename = Guard.ForNullOrWhiteSpace(witnessFileName, nameof(witnessFileName));
			_tagTypes = tagTypes;
		}
开发者ID:Galad,项目名称:musicmirror,代码行数:7,代码来源:FlacTagReader.cs


示例3: Parse

        /// <summary>
        /// 
        /// </summary>
        /// <param name="input"></param>
        /// <param name="caller"></param>
        public override void Parse(Stream input, TagTypes caller)
        {
            BinaryReader br = new BinaryReader(input);

            this._fillStyleCount = br.ReadByte();

            if (this._fillStyleCount.Equals(0xFF))
            {
                this._fillStyleCountExtended = br.ReadUInt16();

                this._fillStyles = new MorphFillStyle[this._fillStyleCountExtended];

                for (UInt16 i = 0; i < this._fillStyleCountExtended; i++)
                {
                    MorphFillStyle temp = new MorphFillStyle(this._SwfVersion);
                    temp.Parse(input);
                    this._fillStyles[i] = temp;
                }
            }
            else
            {
                this._fillStyles = new MorphFillStyle[this._fillStyleCount];

                for (byte i = 0; i < this._fillStyleCount; i++)
                {
                    MorphFillStyle temp = new MorphFillStyle(this._SwfVersion);
                    temp.Parse(input);
                    this._fillStyles[i] = temp;
                }
            }
        }
开发者ID:rtezli,项目名称:Blitzableiter,代码行数:36,代码来源:MorphFillStyleArray.cs


示例4: FillStyle

 /// <summary>
 /// The way how object like lines and shapes get filled.
 /// </summary>
 /// <param name="InitialVersion">The version of the Swf file using this object.</param>
 public FillStyle(byte InitialVersion)
     : base(InitialVersion)
 {
     this._color = new Rgb(this._SwfVersion);
     this._gradientMatrix = new Matrix(this._SwfVersion);
     this._gradient = new Gradient(this._SwfVersion);
     this._bitmapMatrix = new Matrix(this._SwfVersion);
     this._caller = TagTypes.DefineShape;
 }
开发者ID:rtezli,项目名称:Blitzableiter,代码行数:13,代码来源:FILLSTYLE.cs


示例5: FindTag

		// Get the Apple Tag.
		public override TagLib.Tag FindTag(TagTypes type, bool create)
		{
			if (type == TagTypes.Apple)
			{
				if (tag == null && create)
					tag = new Mpeg4AppleTag(this);

				return tag;
			}

			return null;
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:13,代码来源:Mpeg4File.cs


示例6: GetTag

 public override TagLib.Tag GetTag(TagTypes type, bool create)
 {
     if (type != TagTypes.Apple)
     {
         return null;
     }
     if ((this.apple_tag == null) && create)
     {
         this.apple_tag = new AppleTag(this.udta_box);
         TagLib.Tag[] tags = new TagLib.Tag[] { this.apple_tag };
         this.tag.SetTags(tags);
     }
     return this.apple_tag;
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:14,代码来源:File.cs


示例7: FindMpcTag

		private Tag FindMpcTag(TagTypes type, bool create)
		{
			switch (type)
			{
				case TagTypes.Id3v2:
					{
						if (create && id3v2Tag == null)
						{
							id3v2Tag = new Id3v2Tag();

							if (tag != null)
								TagLib.Tag.Duplicate(tag, id3v2Tag, true);

							tag.SetTags(apeTag, id3v2Tag, id3v1Tag);
						}
						return id3v2Tag;
					}

				case TagTypes.Id3v1:
					{
						if (create && id3v1Tag == null)
						{
							id3v1Tag = new Id3v1Tag();

							if (tag != null)
								TagLib.Tag.Duplicate(tag, id3v1Tag, true);

							tag.SetTags(apeTag, id3v2Tag, id3v1Tag);
						}
						return id3v1Tag;
					}

				case TagTypes.Ape:
					{
						if (create && apeTag == null)
						{
							apeTag = new ApeTag();

							if (tag != null)
								TagLib.Tag.Duplicate(tag, apeTag, true);

							tag.SetTags(apeTag, id3v2Tag, id3v1Tag);
						}
						return apeTag;
					}

				default:
					return null;
			}
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:50,代码来源:MpcFile.cs


示例8: Parse

        /// <summary>
        /// 
        /// </summary>
        /// <param name="input"></param>
        /// <param name="caller"></param>
        public void Parse( Stream input, TagTypes caller )
        {
            BinaryReader br = new BinaryReader(input);
            this._ratio = br.ReadByte();

            if (caller.Equals(TagTypes.DefineShape3) || caller.Equals(TagTypes.DefineShape4))
            {
                this._color = new Rgba(this._SwfVersion);
                this._color.Parse(input);
            }
            else
            {
                this._color = new Rgb(this._SwfVersion);
                this._color.Parse(input);
            }
        }
开发者ID:rtezli,项目名称:Blitzableiter,代码行数:21,代码来源:GRADRECORD.cs


示例9: Parse

        /// <summary>
        /// 
        /// </summary>
        /// <param name="input"></param>
        /// <param name="caller"></param>
        public virtual void Parse( Stream input, TagTypes caller )
        {
            BitStream bits = new BitStream( input );
            GradRecord temp = new GradRecord(this._SwfVersion);

            this._spreadMode = ( SpreadMode )bits.GetBits( 2 );
            this._interpolationMode = ( InterPolation )bits.GetBits( 2 );
            this._numGradients = ( byte )bits.GetBits( 4 );

            bits.Reset();

            for ( int i = 0; i < this._numGradients; i++ )
            {
                temp = new GradRecord( this._SwfVersion );
                temp.Parse( input, caller );
                this._gradientRecords.Add( temp );
            }
        }
开发者ID:rtezli,项目名称:Blitzableiter,代码行数:23,代码来源:GRADIENT.cs


示例10: Parse

        /// <summary>
        /// 
        /// </summary>
        /// <param name="input"></param>
        /// <param name="caller"></param>
        public virtual void Parse(Stream input, TagTypes caller)
        {
            BinaryReader br = new BinaryReader(input);

            this._width = br.ReadUInt16();

            if (caller.Equals(TagTypes.DefineShape) || caller.Equals(TagTypes.DefineShape2))
            {
                this._color = new Rgb(this._SwfVersion);

                try
                {
                    this._color.Parse(input);
                }
                catch(SwfFormatException e)
                {
                    throw e;
                }

            }
            else if (caller.Equals(TagTypes.DefineShape3))
            {
                this._color = new Rgba(this._SwfVersion);

                try
                {
                    this._color.Parse(input);
                }
                catch (SwfFormatException e)
                {
                    throw e;
                }

            }
            else
            {
                SwfFormatException e = new SwfFormatException("LineStyle was called by illegal TagType (" + caller.ToString() +").");
               Log.Error(this, e.Message);
            }
        }
开发者ID:rtezli,项目名称:Blitzableiter,代码行数:45,代码来源:LINESTYLE.cs


示例11: 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


示例12: Validate

        public override void Validate(object value)
        {
            if (value is IEnumerable<TagTypes>)
            {
                return;
            }

            var val = value as string;

            if (val != null)
            {
                var parts = val.Split(',');
                var result = new TagTypes[parts.Length];
                for (var i = 0; i < parts.Length; i++)
                {
                    var part = parts[i];
                    result[i] = (TagTypes)Enum.Parse(typeof(TagTypes), part, true);
                }
            }

            throw new ArgumentException("Invalid input for IList<TagTypes>");
        }
开发者ID:blacktau,项目名称:temporaltwist,代码行数:22,代码来源:TagTypeListConfigurationValidator.cs


示例13: Parse

        /// <summary>
        /// 
        /// </summary>
        /// <param name="input"></param>
        /// <param name="caller"></param>
        public override void Parse(Stream input, TagTypes caller)
        {
            BinaryReader br = new BinaryReader(input);

            this._width = br.ReadUInt16();

            BitStream bits = new BitStream(input);

            this._startCapStyle = (CapStyle)(Convert.ToByte(bits.GetBits(2)));
            this._joinstyle = (JoinStyle)(Convert.ToByte(bits.GetBits(2)));

            this._hasFillFlag = (0 != bits.GetBits(1) ? true : false);
            this._noHScale = (0 != bits.GetBits(1) ? true : false);
            this._noVScale = (0 != bits.GetBits(1) ? true : false);
            this._pixelHinting = (0 != bits.GetBits(1) ? true : false);

            bits.GetBits(5); // reserved must be null

            this._noClose = (0 != bits.GetBits(1) ? true : false);

            this._endCapStyle = (CapStyle)bits.GetBits(2);

            if (this._joinstyle.Equals(JoinStyle.Miter))
            {
                bits.Reset();
                this._miterLimtiFactor = br.ReadUInt16();
            }
            if (!this._hasFillFlag)
            {
                bits.Reset();
                this._color.Parse(input);
            }
            if (this._hasFillFlag)
            {
                bits.Reset();
                this._fillStyle.Parse(input, caller);
            }
        }
开发者ID:rtezli,项目名称:Blitzableiter,代码行数:43,代码来源:LINESTYLE2.cs


示例14: GetTag

		/// <summary>
		///    Gets a tag of a specified type from the current instance,
		///    optionally creating a new tag if possible.
		/// </summary>
		/// <param name="type">
		///    A <see cref="TagLib.TagTypes" /> value indicating the
		///    type of tag to read.
		/// </param>
		/// <param name="create">
		///    A <see cref="bool" /> value specifying whether or not to
		///    try and create the tag if one is not found.
		/// </param>
		/// <returns>
		///    A <see cref="Tag" /> object containing the tag that was
		///    found in or added to the current instance. If no
		///    matching tag was found and none was created, <see
		///    langref="null" /> is returned.
		/// </returns>
		/// <remarks>
		///    If a <see cref="TagLib.Id3v2.Tag" /> is added to the
		///    current instance, it will be placed at the start of the
		///    file. On the other hand, <see cref="TagLib.Id3v1.Tag" />
		///    <see cref="TagLib.Ape.Tag" /> will be added to the end of
		///    the file. All other tag types will be ignored.
		/// </remarks>
		public override TagLib.Tag GetTag (TagTypes type, bool create)
		{
			Tag t = (Tag as TagLib.NonContainer.Tag).GetTag (type);
			
			if (t != null || !create)
				return t;
			
			switch (type)
			{
			case TagTypes.Id3v1:
				return EndTag.AddTag (type, Tag);
			
			case TagTypes.Id3v2:
				return EndTag.AddTag (type, Tag);
			
			case TagTypes.Ape:
				return EndTag.AddTag (type, Tag);
			
			default:
				return null;
			}
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:47,代码来源:File.cs


示例15: RemoveTags

 public override void RemoveTags(TagTypes types)
 {
     throw new System.NotImplementedException ();
 }
开发者ID:nuxleus,项目名称:taglib-sharp,代码行数:4,代码来源:FileTest.cs


示例16: GetTag

 public override Tag GetTag(TagTypes type, bool create)
 {
     throw new System.NotImplementedException ();
 }
开发者ID:nuxleus,项目名称:taglib-sharp,代码行数:4,代码来源:FileTest.cs


示例17: RemoveTags

        /// <summary>
        ///    Removes a set of tag types from the current instance.
        /// </summary>
        /// <param name="types">
        ///    A bitwise combined <see cref="TagLib.TagTypes" /> value
        ///    containing tag types to be removed from the file.
        /// </param>
        /// <remarks>
        ///    In order to remove all tags from a file, pass <see
        ///    cref="TagTypes.AllTags" /> as <paramref name="types" />.
        /// </remarks>
        public override void RemoveTags(TagTypes types)
        {
            if ((types & TagLib.TagTypes.Id3v2) != TagLib.TagTypes.None)
                id32_tag = null;
            if ((types & TagLib.TagTypes.RiffInfo) != TagLib.TagTypes.None)
                info_tag = null;
            if ((types & TagLib.TagTypes.MovieId) != TagLib.TagTypes.None)
                mid_tag  = null;
            if ((types & TagLib.TagTypes.DivX) != TagLib.TagTypes.None)
                divx_tag = null;

            tag.SetTags (id32_tag, info_tag, mid_tag, divx_tag);
        }
开发者ID:Sirais,项目名称:taglib-sharp-portable,代码行数:24,代码来源:File.cs


示例18: GetTag

        /// <summary>
        ///    Gets a tag of a specified type from the current instance,
        ///    optionally creating a new tag if possible.
        /// </summary>
        /// <param name="type">
        ///    A <see cref="TagLib.TagTypes" /> value indicating the
        ///    type of tag to read.
        /// </param>
        /// <param name="create">
        ///    A <see cref="bool" /> value specifying whether or not to
        ///    try and create the tag if one is not found.
        /// </param>
        /// <returns>
        ///    A <see cref="Tag" /> object containing the tag that was
        ///    found in or added to the current instance. If no
        ///    matching tag was found and none was created, <see
        ///    langword="null" /> is returned.
        /// </returns>
        public override TagLib.Tag GetTag(TagTypes type, bool create)
        {
            TagLib.Tag tag = null;

            switch (type)
            {
            case TagTypes.Id3v2:
                if (id32_tag == null && create) {
                    id32_tag = new Id3v2.Tag ();
                    id32_tag.Version = 4;
                    id32_tag.Flags |= Id3v2.HeaderFlags
                        .FooterPresent;
                    this.tag.CopyTo (id32_tag, true);
                }

                tag = id32_tag;
                break;

            case TagTypes.RiffInfo:
                if (info_tag == null && create) {
                    info_tag = new InfoTag ();
                    this.tag.CopyTo (info_tag, true);
                }

                tag = info_tag;
                break;

            case TagTypes.MovieId:
                if (mid_tag == null && create) {
                    mid_tag = new MovieIdTag ();
                    this.tag.CopyTo (mid_tag, true);
                }

                tag = mid_tag;
                break;

            case TagTypes.DivX:
                if (divx_tag == null && create) {
                    divx_tag = new DivXTag ();
                    this.tag.CopyTo (divx_tag, true);
                }

                tag = divx_tag;
                break;
            }

            this.tag.SetTags (id32_tag, info_tag, mid_tag, divx_tag);
            return tag;
        }
开发者ID:Sirais,项目名称:taglib-sharp-portable,代码行数:67,代码来源:File.cs


示例19: RemoveTags

 /// <summary>
 ///    Removes a set of tag types from the current instance.
 /// </summary>
 /// <param name="types">
 ///    A bitwise combined <see cref="TagLib.TagTypes" /> value
 ///    containing tag types to be removed from the file.
 /// </param>
 /// <remarks>
 ///    In order to remove all tags from a file, pass <see
 ///    cref="TagTypes.AllTags" /> as <paramref name="types" />.
 /// </remarks>
 public override void RemoveTags(TagTypes types)
 {
     if (types == TagLib.TagTypes.Id3v2 ||
         types == TagLib.TagTypes.AllTags)
     {
         tag = null;
     }
 }
开发者ID:sanyaade-embedded-systems,项目名称:MPTagThat,代码行数:19,代码来源:File.cs


示例20: GetTag

        /// <summary>
        ///    Gets a tag of a specified type from the current instance,
        ///    optionally creating a new tag if possible.
        /// </summary>
        /// <param name="type">
        ///    A <see cref="TagLib.TagTypes" /> value indicating the
        ///    type of tag to read.
        /// </param>
        /// <param name="create">
        ///    A <see cref="bool" /> value specifying whether or not to
        ///    try and create the tag if one is not found.
        /// </param>
        /// <returns>
        ///    A <see cref="Tag" /> object containing the tag that was
        ///    found in or added to the current instance. If no
        ///    matching tag was found and none was created, <see
        ///    langword="null" /> is returned.
        /// </returns>
        public override TagLib.Tag GetTag(TagTypes type, bool create)
        {
            TagLib.Tag id32_tag = null;

            switch (type)
            {
                case TagTypes.Id3v2:
                    if (tag == null && create)
                    {
                        tag = new Id3v2.Tag();
                        tag.Version = 2;
                    }

                    id32_tag = tag;
                    break;
            }

            return id32_tag;
        }
开发者ID:sanyaade-embedded-systems,项目名称:MPTagThat,代码行数:37,代码来源:File.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Tags类代码示例发布时间:2022-05-24
下一篇:
C# TagType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap