/// <summary> /// Class Constructor. /// </summary> /// <param name="tag">Tag (group/element combination).</param> public TagType(Tag tag) { _tag = new Tag(); _tag.GroupNumber = tag.GroupNumber; _tag.ElementNumber = tag.ElementNumber; _type = TagTypeEnum.TagOptional; }
/// <summary> /// Class Constructor. /// </summary> /// <param name="tag">Tag (group/element combination).</param> /// <param name="type">Tag Type.</param> public TagType(Tag tag, TagTypeEnum type) { _tag = new Tag(); _tag.GroupNumber = tag.GroupNumber; _tag.ElementNumber = tag.ElementNumber; _type = type; }
public ReplacementFragment(int nPosition, int nLength, string strTagName, TagTypeEnum ttType, string strOriginal, string strReplacement) { m_nPosition = nPosition; m_nLength = nLength; m_strTagName = strTagName; m_ttType = ttType; m_strOriginal = strOriginal; m_strReplacement = strReplacement; }
public async Task <IActionResult> GetList(TagTypeEnum tagType) { var tagList = await _tagService.getTagsPerType(tagType); if (tagList == null || tagList.Count == 0) { return(NotFound()); } return(Ok(tagList)); }
public FLVTag(FileStream fs) { byte[] headerbytes = new byte[11]; fs.Read(headerbytes, 0, 11); tagtype = (TagTypeEnum)headerbytes[0]; var tmpSize = headerbytes.Skip(1).Take(3).ToList(); tmpSize.Insert(0, 0); tmpSize.Reverse(); tagSize = BitConverter.ToUInt32(tmpSize.ToArray(), 0); }
private static void AddTag(List <TagItem> tagList, TagTypeEnum type, string content, int index, string icon = null) { if (string.IsNullOrEmpty(content)) { return; } if (content.Length > 5) { content = content.Substring(0, 4) + "..."; } tagList.Add(new TagItem() { Type = type, Content = content, Icon = icon, Index = index }); }
public void ParseElement(int beginPos, int startPos, ref int endPos, string opener, ref string xmlText) { int initialPos = startPos; _indentLevel++; beginPos = startPos; string actualTagContent = string.Empty; string interTagContent = string.Empty; string tagName = string.Empty; string tag = null; while (startPos < xmlText.Length) { actualTagContent = string.Empty; interTagContent = string.Empty; tag = ReadTag(xmlText, ref actualTagContent, ref interTagContent, ref startPos, ref endPos); if (tag != null) { if (tag.EndsWith("/>") || tag.EndsWith("/>}")) { NoteTagType(TagTypeEnum.SelfClosing); RemoveIntertagContentWhitespace(ref tag, ref interTagContent); AppendClosingXml(tag, interTagContent, true); } else if (tag.EndsWith("?>") || tag.EndsWith("?>}")) { NoteTagType(TagTypeEnum.SelfClosing); AppendClosingXml(tag, interTagContent, true); } else if (tag.StartsWith("</")) { RemoveIntertagContentWhitespace(ref tag, ref interTagContent); NoteTagType(TagTypeEnum.Close); int consumedLen = endPos - initialPos + 1 - tag.Length; string consumedText = xmlText.Substring(initialPos, consumedLen); if (consumedText.Contains("<") && consumedText.Contains(">")) { AppendClosingXml(tag, interTagContent, true); } else { AppendClosingXml(tag, interTagContent, false); } break; } else if (tag.StartsWith("<?")) { NoteTagType(TagTypeEnum.SelfClosing); AppendClosingXml(tag, interTagContent, true); } else if (tag.Trim().Length == 0) { NoteTagType(TagTypeEnum.Undefined); if (_someXmlFound) { endPos++; } break; } else { if (_indentLevel == 0) { if (interTagContent.EndsWith("?") || interTagContent.EndsWith("¤")) { //This will force a new line if there is not already a new line between the "?" or "¤" and the first opening "<" of the first XML tag. _thisTagType = TagTypeEnum.Open; } } else { RemoveIntertagContentWhitespace(ref tag, ref interTagContent); } NoteTagType(TagTypeEnum.Open); AppendOpeningXml(tag); startPos = endPos + 1; ParseElement(beginPos, startPos, ref endPos, tag, ref xmlText); } } startPos = endPos + 1; } _indentLevel--; }
public MDTag(string tag, TagTypeEnum tagType, ITag parent) : this(tag, tagType) { Parent = parent; }
/// <summary> /// Class Constructor. /// </summary> /// <param name="group">Tag - group number.</param> /// <param name="element">Tag - element number.</param> public TagType(System.UInt16 group, System.UInt16 element) { _tag = new Tag(group, element); _type = TagTypeEnum.TagOptional; }
/// <summary> /// Class Constructor. /// </summary> /// <param name="group">Tag - group number.</param> /// <param name="element">Tag - element number.</param> /// <param name="type">Tag Type.</param> public TagType(System.UInt16 group, System.UInt16 element, TagTypeEnum type) { _tag = new Tag(group, element); _type = type; }
private void NoteTagType(TagTypeEnum tagType) { _prevTagType = _thisTagType; _thisTagType = tagType; }
public void ParseElement(int beginPos, int startPos, ref int endPos, string opener, ref string xmlText) { int initialPos = startPos; _indentLevel++; beginPos = startPos; string actualTagContent = string.Empty; string interTagContent = string.Empty; string tagName = string.Empty; string tag = null; while (startPos < xmlText.Length) { actualTagContent = string.Empty; interTagContent = string.Empty; tag = ReadTag(xmlText, ref actualTagContent, ref interTagContent, ref startPos, ref endPos); if (tag != null) { if (tag.StartsWith("<!--") && tag.EndsWith("-->")) { NoteTagType(TagTypeEnum.Comment); string comment = tag; AppendCommentXml(ref comment); } else if (tag.EndsWith("/>") || tag.EndsWith("/>}")) { NoteTagType(TagTypeEnum.SelfClosing); if (_indentLevel == 0) { AppendCommandsOutsideXml(ref interTagContent); } RemoveIntertagContentWhitespace(ref tag, ref interTagContent); if (interTagContent.Length > 0) { AppendCommandsOutsideXml(ref interTagContent); } AppendClosingXml(tag, interTagContent, true); } else if (tag.EndsWith("?>") || tag.EndsWith("?>}")) { NoteTagType(TagTypeEnum.SelfClosing); if (_indentLevel == 0) { AppendCommandsOutsideXml(ref interTagContent); } AppendClosingXml(tag, interTagContent, true); } else if (tag.StartsWith("</")) { RemoveIntertagContentWhitespace(ref tag, ref interTagContent); NoteTagType(TagTypeEnum.Close); int consumedLen = endPos - initialPos + 1 - tag.Length; string consumedText = xmlText.Substring(initialPos, consumedLen); bool includeNewLines = false; if (consumedText.Contains("<") && consumedText.Contains(">")) { includeNewLines = true; } string poppedTagName = (string)TagStack.Pop(); string closingTagName = ParseClosingTagName(actualTagContent); if (poppedTagName != closingTagName && TagStack.Count > 0) { string missingTag = String.Format(@"</{0}>", poppedTagName); AppendClosingXml(missingTag, interTagContent, includeNewLines); interTagContent = string.Empty; _indentLevel--; if (TagStack.Count > 0) { poppedTagName = (string)TagStack.Pop(); } } //while (poppedTagName != closingTagName && TagStack.Count > 0) //{ // string missingTag = String.Format(@"</{0}>", poppedTagName); // AppendClosingXml(missingTag, interTagContent, includeNewLines); // interTagContent = string.Empty; // _indentLevel--; // if (TagStack.Count > 0) // { // poppedTagName = (string)TagStack.Pop(); // } //}; AppendClosingXml(tag, interTagContent, includeNewLines); break; } else if (tag.StartsWith("<?")) { NoteTagType(TagTypeEnum.SelfClosing); AppendClosingXml(tag, interTagContent, true); } else if (tag.Trim().Length == 0) { NoteTagType(TagTypeEnum.Undefined); if (_someXmlFound) { endPos++; } break; } else { if (_indentLevel == 0) { if (interTagContent.EndsWith("?") || interTagContent.EndsWith("¤")) { //This will force a new line if there is not already a new line between the "?" or "¤" and the first opening "<" of the first XML tag. _thisTagType = TagTypeEnum.Open; } AppendCommandsOutsideXml(ref interTagContent); } else { RemoveIntertagContentWhitespace(ref tag, ref interTagContent); if (interTagContent.Length > 0) { AppendCommandsOutsideXml(ref interTagContent); } } NoteTagType(TagTypeEnum.Open); tagName = ParseOpeningTagName(actualTagContent); TagStack.Push(tagName); if (TagStack.Count > 512) { endPos = xmlText.Length - 1; break; } AppendOpeningXml(tag); startPos = endPos + 1; ParseElement(beginPos, startPos, ref endPos, tag, ref xmlText); } } startPos = endPos + 1; if (TagStack.Count == 0) { break; } } if (_indentLevel == 0) { if (endPos <= xmlText.Length) { string endText = xmlText.Substring(endPos); if (endText != ">") { AppendCommandsOutsideXml(ref endText); } } } _indentLevel--; }
/// <summary> /// Class Constructor. /// </summary> /// <param name="group">Tag - group number.</param> /// <param name="element">Tag - element number.</param> public TagType(System.UInt16 group, System.UInt16 element) { _tag = new Tag(group, element); _type = TagTypeEnum.TagOptional; _vr = VR.UN; }
/// <summary> /// Class Constructor. /// </summary> /// <param name="group">Tag - group number.</param> /// <param name="element">Tag - element number.</param> /// <param name="type">Tag Type.</param> public TagType(System.UInt16 group, System.UInt16 element, TagTypeEnum type) { _tag = new Tag(group, element); _type = type; _vr = VR.UN; }
public InputElement(TagTypeEnum tagtype) { SendFieldInResponse = true; TagType = tagtype; }
private static void AddItem(List <ContentItem> resultList, int index, string title, string content, TagTypeEnum type = TagTypeEnum.Default, string icon = null) { if (string.IsNullOrEmpty(content)) { return; } resultList.Add(new ContentItem() { Type = type, Title = "", Content = string.Format("{0}:{1}", title, content), Icon = icon, Index = index }); }
public HTMLTag(string tag, TagTypeEnum tagType) { StringTag = tag; TagType = tagType; this.Length = StringTag.Length; }
public InputElement(TagTypeEnum tagtype) { TagType = tagtype; }
public async Task <List <Tag> > getTagsPerType(TagTypeEnum type) { var tagsList = await _context.Tags.Where(x => x.tagType == type).ToListAsync(); return(tagsList); }
public string GetTagName(TagTypeEnum expectedType, LocationEnum location) { return(Tags.FirstOrDefault(el => el.Type == expectedType && el.Location == location).Name); }
public List <TagType> GetTagList(List <UserTagEntity> userTagList, TagTypeEnum tagType) { List <string> defaultTagList = null; switch (tagType) { case TagTypeEnum.个性标签: defaultTagList = ConstUtil.CHARACTER_TAG_LIST; break; case TagTypeEnum.运动标签: defaultTagList = ConstUtil.SPORT_TAG_LIST; break; case TagTypeEnum.音乐标签: defaultTagList = ConstUtil.MUSIC_TAG_LIST; break; case TagTypeEnum.食物标签: defaultTagList = ConstUtil.FOOD_TAG_LIST; break; case TagTypeEnum.电影标签: defaultTagList = ConstUtil.MOVIE_TAG_LIST; break; case TagTypeEnum.旅行标签: defaultTagList = ConstUtil.TRAVEL_TAG_LIST; break; default: return(null); } var rtnList = new List <TagType>(); if (userTagList.NotEmpty()) { var selectedTagList = userTagList.Where(a => a.TagType == tagType).ToList(); if (selectedTagList.NotEmpty()) { foreach (var item in selectedTagList.OrderByDescending(a => a.CreateTime)) { rtnList.Add(new TagType { Tag = item.Tag, Checked = true }); } AddDefaultTag(defaultTagList, rtnList); } else { AddDefaultTag(defaultTagList, rtnList); } } else { AddDefaultTag(defaultTagList, rtnList); } return(rtnList); }