コード例 #1
0
 public static bool IsBaseTag(HtmlTagId tagId, HtmlTagContextAttribute attribute)
 {
     return(tagId == HtmlTagId.Base && attribute.Id == HtmlAttributeId.Href);
 }
コード例 #2
0
ファイル: FlowedToHtml.cs プロジェクト: cybercircuits/MimeKit
			public FlowedToHtmlTagContext (HtmlTagId tag, HtmlAttribute attr) : base (tag)
			{
				attrs = new HtmlAttributeCollection (new [] { attr });
			}
コード例 #3
0
 protected static bool IsUrlTag(HtmlTagId tagId, HtmlTagContextAttribute attribute)
 {
     return((tagId == HtmlTagId.A && attribute.Id == HtmlAttributeId.Href) || (tagId == HtmlTagId.Area && attribute.Id == HtmlAttributeId.Href));
 }
コード例 #4
0
 protected static bool IsImageTag(HtmlTagId tagId, HtmlTagContextAttribute attribute)
 {
     return((tagId == HtmlTagId.Img && attribute.Id == HtmlAttributeId.Src) || (tagId == HtmlTagId.Img && attribute.Id == HtmlAttributeId.DynSrc) || (tagId == HtmlTagId.Img && attribute.Id == HtmlAttributeId.LowSrc));
 }
コード例 #5
0
ファイル: TextToHtml.cs プロジェクト: stjordanis/MimeKit
 public TextToHtmlTagContext(HtmlTagId tag, HtmlAttribute attr) : base(tag)
 {
     attributes = new HtmlAttributeCollection(new [] { attr });
 }
コード例 #6
0
ファイル: TextToHtml.cs プロジェクト: stjordanis/MimeKit
 public TextToHtmlTagContext(HtmlTagId tag) : base(tag)
 {
     attributes = HtmlAttributeCollection.Empty;
 }
コード例 #7
0
ファイル: HtmlWriter.cs プロジェクト: prepare/WebParser
		/// <summary>
		/// Write a start tag.
		/// </summary>
		/// <remarks>
		/// Writes a start tag.
		/// </remarks>
		/// <param name="id">The HTML tag identifier.</param>
		/// <exception cref="System.ArgumentException">
		/// <paramref name="id"/> is not a valid HTML tag identifier.
		/// </exception>
		/// <exception cref="System.ObjectDisposedException">
		/// The <see cref="HtmlWriter"/> has been disposed.
		/// </exception>
		public void WriteStartTag (HtmlTagId id)
		{
			if (id == HtmlTagId.Unknown)
				throw new ArgumentException ("Invalid tag.", "id");

			CheckDisposed ();

			if (WriterState != HtmlWriterState.Default) {
				html.Write (empty ? "/>" : ">");
				empty = false;
			}

			html.Write (string.Format ("<{0}", id.ToHtmlTagName ()));
			WriterState = HtmlWriterState.Tag;
		}
コード例 #8
0
 internal int FindEndTag(int from, HtmlTagId tagId)
 {
     return(FindEndTag(this.nodes, from, tagId));
 }
コード例 #9
0
 protected static bool IsTargetTagInAnchor(HtmlTagId tagId, HtmlTagContextAttribute attr)
 {
     return((tagId == HtmlTagId.A && attr.Id == HtmlAttributeId.Target) || (tagId == HtmlTagId.Area && attr.Id == HtmlAttributeId.Target));
 }
コード例 #10
0
 protected static bool IsFormElementTag(HtmlTagId tagId)
 {
     return(tagId == HtmlTagId.Input || tagId == HtmlTagId.Button || tagId == HtmlTagId.Select || tagId == HtmlTagId.OptGroup || tagId == HtmlTagId.Option || tagId == HtmlTagId.FieldSet || tagId == HtmlTagId.TextArea || tagId == HtmlTagId.IsIndex || tagId == HtmlTagId.Label || tagId == HtmlTagId.Legend);
 }
コード例 #11
0
 public bool IsEndTag(HtmlTagId id)
 {
     return(NodeType == HtmlNodeType.EndTag && TagId == id);
 }
コード例 #12
0
 public bool IsStartTag(HtmlTagId id)
 {
     return(NodeType == HtmlNodeType.Element && TagId == id);
 }
コード例 #13
0
ファイル: HtmlTagContext.cs プロジェクト: ruffin--/MimeKit
		/// <summary>
		/// Initializes a new instance of the <see cref="MimeKit.Text.HtmlTagContext"/> class.
		/// </summary>
		/// <remarks>
		/// Creates a new <see cref="HtmlTagContext"/>.
		/// </remarks>
		/// <param name="tagId">The HTML tag identifier.</param>
		/// <exception cref="System.ArgumentOutOfRangeException">
		/// <paramref name="tagId"/> is invalid.
		/// </exception>
		protected HtmlTagContext (HtmlTagId tagId)
		{
			TagId = tagId;
		}
コード例 #14
0
ファイル: FlowedToHtml.cs プロジェクト: cybercircuits/MimeKit
			public FlowedToHtmlTagContext (HtmlTagId tag) : base (tag)
			{
				attrs = HtmlAttributeCollection.Empty;
			}
コード例 #15
0
 public HtmlTagContext(HtmlTagId id)
 {
     TagId = id;
 }
コード例 #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MimeKit.Text.HtmlTagContext"/> class.
 /// </summary>
 /// <remarks>
 /// Creates a new <see cref="HtmlTagContext"/>.
 /// </remarks>
 /// <param name="tagId">The HTML tag identifier.</param>
 /// <exception cref="System.ArgumentOutOfRangeException">
 /// <paramref name="tagId"/> is invalid.
 /// </exception>
 protected HtmlTagContext(HtmlTagId tagId)
 {
     TagId = tagId;
 }
コード例 #17
0
 /// <summary>
 /// Converts the enum value into the equivalent tag name.
 /// </summary>
 /// <remarks>
 /// Converts the enum value into the equivalent tag name.
 /// </remarks>
 /// <returns>The tag name.</returns>
 /// <param name="value">The enum value.</param>
 public static string ToHtmlTagName(this HtmlTagId value)
 {
     return(tagsToNames[value]);
 }