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

C# TagType类代码示例

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

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



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

示例1: IsCastableTo

 /// <summary>
 /// Checks if the node is castable to another node of a given tag type.
 /// </summary>
 /// <param name="type">An NBT tag type.</param>
 /// <returns>Status indicating whether this object could be cast to a node type represented by the given tag type.</returns>
 public override bool IsCastableTo (TagType type)
 {
     return (type == TagType.TAG_BYTE ||
         type == TagType.TAG_SHORT ||
         type == TagType.TAG_INT ||
         type == TagType.TAG_LONG);
 }
开发者ID:tofurama3000,项目名称:Substrate,代码行数:12,代码来源:TagNodeByte.cs


示例2: NXPTag

 public NXPTag(TagType type)
 {
     tag = new Tag();
     tag.Type = type;
     password = new byte[4] { 0, 0, 0, 0 };
     retries = 1;
 }
开发者ID:JaegarSarauer,项目名称:DCOMM-Assign2,代码行数:7,代码来源:TagNXP.cs


示例3: GetNextNode

 /// <summary>
 /// Gets the next node after the start index
 /// </summary>
 /// <param name="code">The code.</param>
 /// <param name="startIndex">The index from which to start searching.</param>
 /// <param name="tagType">Returns next tag type</param>
 /// <param name="previousTag">The previous tag in the stack.</param>
 /// <param name="isParseContent">If the content of the last opening node should be parsed. In Html all the content is parsed.</param>        
 protected override SyntaxNode GetNextNode(string code, ref int startIndex, out TagType tagType, Tag previousTag, bool isParseContent)
 {
     string currentSubstring = code.Substring(startIndex);
     //in the regex I won't work with h1, h2... and such tags!
     string regexPattern = previousTag == null || isParseContent ? @"</?[a-zA-Z]+[^<>]*/?>" : @"<" + previousTag.CloseTag + @">";
     Match tag = Regex.Match(currentSubstring, regexPattern);
     Tag registeredTag = null;
     tagType = TagType.Open; //we just set it here and when needed will do it later
     while (tag.Success && (registeredTag = GetTagByValue(tag.Value)) == null)//getting tags, but they are not registered.
     {
         tag = tag.NextMatch();
     }
     if (!tag.Success) //didn't find a registered tag until the end - return everything left as a text node
     {
         startIndex += currentSubstring.Length;
         return new TextSyntaxNode(currentSubstring);
     }
     if (tag.Index == 0) //if the string given to the matcher was something like '<strong>...'
     {
         if (tag.Value.StartsWith("</"))
         {
             tagType = TagType.Close;
         }
         else if (tag.Value.EndsWith("/>"))
         {
             tagType = TagType.SelfClose;
         }
         startIndex += tag.Value.Length;
         return new HtmlSyntaxNode(registeredTag as HtmlTag, tag.Value);
     }
     //there has been some text before the tag that I found...
     startIndex += tag.Index; //move the start index for the other iterations
     return new TextSyntaxNode(currentSubstring.Substring(0, tag.Index));
 }
开发者ID:nikolovivan,项目名称:CodeTranslator,代码行数:42,代码来源:HtmlParser.cs


示例4: CanCreateTag

 public override bool CanCreateTag(TagType type)
 {
     if (Tag.Count > 0)
         return Tag.ValueType == type;
     else
         return Enum.IsDefined(typeof(TagType), type) && type != TagType.TAG_END;
 }
开发者ID:hach-que,项目名称:NBTExplorer,代码行数:7,代码来源:TagListDataNode.cs


示例5: ReadTag

    protected ITag ReadTag(ReadTagOptions options, TagType defaultTagType)
    {
      ITag result;
      TagType type;

      this.InitializeReader();

      type = this.ReadTagType(defaultTagType);
      result = TagFactory.CreateTag(type);

      if ((options & ReadTagOptions.IgnoreName) == 0)
      {
        string name;

        name = _reader.GetAttribute("name");
        if (string.IsNullOrEmpty(name))
        {
          name = _reader.Name;
        }

        result.Name = name;
      }

      if ((options & ReadTagOptions.IgnoreValue) == 0)
      {
        result.Value = this.ReadTagValue(result);
      }

      return result;
    }
开发者ID:cyotek,项目名称:Cyotek.Data.Nbt,代码行数:30,代码来源:XmlTagReader.cs


示例6: GetId3Data

 public string this[TagType type]
 {
     get { return GetId3Data()[type]; }
     set
     {
         switch (type)
         {
             case TagType.Artist:
                 Artist = value;
                 break;
             case TagType.Id:
                 TrackId = value;
                 break;
             case TagType.Title:
                 Title = value;
                 break;
             case TagType.Album:
                 Album = value;
                 break;
             case TagType.Genre:
                 Genre = value;
                 break;
             case TagType.Year:
                 Year = value;
                 break;
             case TagType.Comment:
                 Comment = value;
                 break;
             default:
                 throw new ArgumentOutOfRangeException(type.ToString(), type, null);
         }
     }
 }
开发者ID:Confirmit,项目名称:Students,代码行数:33,代码来源:TestMp3File.cs


示例7: GetInfoFromUser

        //TODO: move to separate class {READY}
        public UserData GetInfoFromUser(TagType tag, Diff diff, IMp3File file, ICommunication communication)
        {
            communication.SendMessage($"File: {file.FilePath}");
            communication.SendMessage($"There is a problem with tag \"{tag}\". ");
            communication.SendMessage(
                $"You can enter tag from: \n\t1) File name (Data: \"{diff.FileNameValue}\"), \n\t2) Mp3 Tags (Data: \"{diff.TagValue}\"), \n\t3) Manual");

            while (true)
            {
                communication.SendMessage("Your choise (number): ");
                SyncActions inputData;
                var choiseCorrect = Enum.TryParse(communication.GetResponse(), out inputData);
                if (!choiseCorrect)
                {
                    communication.SendMessage("Wrong input!");
                    communication.SendMessage("You sholud enter number with action!");
                    continue;
                }

                switch (inputData)
                {
                    case SyncActions.FromFileName:
                        return new UserData(inputData, diff.FileNameValue);
                    case SyncActions.FromTags:
                        return new UserData(inputData, diff.TagValue);
                    case SyncActions.Manual:
                        communication.SendMessage("Enter text for tag \"" + tag + "\"");
                        return new UserData(inputData, communication.GetResponse());
                }
            }
        }
开发者ID:Confirmit,项目名称:Students,代码行数:32,代码来源:CommunicationWithUser.cs


示例8: OpenTag

 public OpenTag(TagType tag, IEnumerable<IExpression> arguments) {
     _Tag = tag;
     if (arguments == null)
         _Arguments = new IExpression[0];
     else
         _Arguments = arguments.ToArray();
 }
开发者ID:mclark4386,项目名称:SaintCoinach,代码行数:7,代码来源:OpenTag.cs


示例9: GetNextNode

 /// <summary>
 /// Gets the next node after the start index.
 /// </summary>
 /// <param name="code">The code.</param>
 /// <param name="startIndex">The index from which to start searching.</param>
 /// <param name="tagType">Returns the next tag type</param>
 /// <param name="previousTag">The previous tag in the stack.</param>
 /// <param name="isParseContent">If the content of the last opening node should be parsed.</param>
 /// <returns></returns>
 protected override SyntaxNode GetNextNode(string code, ref int startIndex, out TagType tagType, Tag previousTag, bool isParseContent)
 {
     string currentSubstring = code.Substring(startIndex);
     string regexPattern = previousTag == null || isParseContent ? @"\[/?[a-z*][a-z0-9]*(=[^\[\]\n\r\v\f]+)?\]" : @"\[" + previousTag.CloseTag + @"\]"; //the close tag has /
     Match tag = Regex.Match(currentSubstring, regexPattern);
     Tag registeredTag = null;
     tagType = TagType.Open; //we just set it here and when needed will do it later
     while (tag.Success && (registeredTag = GetTagByValue(tag.Value)) == null)//getting tags, but they are not registered.
     {
         tag = tag.NextMatch();
     }
     if (!tag.Success) //didn't find a registered tag until the end - return everything left as a text node
     {
         startIndex += currentSubstring.Length;
         return new TextSyntaxNode(currentSubstring);
     }
     if (tag.Index == 0) //if the string given to the matcher was something like '[b]...'
     {
         if (tag.Value.StartsWith("[/")) tagType = TagType.Close;
         startIndex += tag.Value.Length;
         return new BBCodeSyntaxNode(registeredTag as BBTag, tag.Value);
     }
     //there has been some text before the tag that I found...
     startIndex += tag.Index; //move the start index for the other iterations
     return new TextSyntaxNode(currentSubstring.Substring(0, tag.Index));
 }
开发者ID:nikolovivan,项目名称:CodeTranslator,代码行数:35,代码来源:BBCodeParser.cs


示例10: TagData

        public TagData(string name, Hash sha1, TagType tagType)
        {
            Verify.Argument.IsNeitherNullNorWhitespace(name, "name");

            _name    = name;
            _sha1    = sha1;
            _tagType = tagType;
        }
开发者ID:Kuzq,项目名称:gitter,代码行数:8,代码来源:TagData.cs


示例11: CreateFormFile

        public static TagsManager CreateFormFile(String file, TagType type = TagType.Automatic, bool parseTags = true)
        {
            var handle = TagsLibCoreModule.CreateFunction.Delegate();
            var result = new TagsManager(handle);

            TagsLibCoreModule.LoadTagsFunction.Delegate(handle, file, type, parseTags);

            return result;
        }
开发者ID:higankanshi,项目名称:xZune.Bass,代码行数:9,代码来源:TagsManager.cs


示例12: IfElement

 public IfElement(TagType tag, INode condition, INode trueValue, INode falseValue)
 {
     if (condition == null)
         throw new ArgumentNullException("condition");
     _Tag = tag;
     _Condition = condition;
     _TrueValue = trueValue;
     _FalseValue = falseValue;
 }
开发者ID:drmcknight,项目名称:SaintCoinach,代码行数:9,代码来源:IfElement.cs


示例13: CreateFormMemory

        public static TagsManager CreateFormMemory(IntPtr memory, ulong size, TagType type = TagType.Automatic, bool parseTags = true)
        {
            var handle = TagsLibCoreModule.CreateFunction.Delegate();
            var result = new TagsManager(handle);

            TagsLibCoreModule.LoadTagsFormMemoryFunction.Delegate(handle, memory, size, type, parseTags);

            return result;
        }
开发者ID:higankanshi,项目名称:xZune.Bass,代码行数:9,代码来源:TagsManager.cs


示例14: SwitchElement

 public SwitchElement(TagType tag, INode caseSwitch, IDictionary<int, INode> cases)
 {
     if (caseSwitch == null)
         throw new ArgumentNullException("caseSwitch");
     if (cases == null)
         throw new ArgumentNullException("cases");
     _Tag = tag;
     _CaseSwitch = caseSwitch;
     _Cases = new ReadOnlyDictionary<int, INode>(cases);
 }
开发者ID:drmcknight,项目名称:SaintCoinach,代码行数:10,代码来源:SwitchElement.cs


示例15: CreateNodeForm

        public CreateNodeForm(TagType tagType, bool hasName)
        {
            InitializeComponent();

            _type = tagType;
            _hasName = hasName;

            SetNameBoxState();
            SetSizeBoxState();
        }
开发者ID:hach-que,项目名称:NBTExplorer,代码行数:10,代码来源:CreateNode.cs


示例16: GetUserTags

		public override TagCollection GetUserTags(int userID, TagType type)
		{
			switch (type)
			{
				case TagType.Blog:
					return GetUserBlogTags(userID);

				default:
					return new TagCollection();
			}
		}
开发者ID:huchao007,项目名称:bbsmax,代码行数:11,代码来源:TagDao.cs


示例17: Tag

 public Tag(string name, TagType type, Guid owner, FileEntry entry)
 {
     TagName = name;
     TagType = type;
     Owner = owner;
     if (entry != null)
     {
         EntryId = entry.ID;
         EntryType = entry is File ? FileEntryType.File : FileEntryType.Folder;
     }
 }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:11,代码来源:Tag.cs


示例18: CreateNode

        public override bool CreateNode(TagType type)
        {
            if (!CanCreateTag(type))
                return false;

            if (Tag.Count == 0) {
                Tag.ChangeValueType(type);
            }

            AppendTag(TagDataNode.DefaultTag(type));
            return true;
        }
开发者ID:hach-que,项目名称:NBTExplorer,代码行数:12,代码来源:TagListDataNode.cs


示例19: GetTags

        public IEnumerable<Tag> GetTags(Guid owner, TagType tagType)
        {
            var q = Query("files_tag t")
                .InnerJoin("files_tag_link l", Exp.EqColumns("l.tag_id", "t.id"))
                .Select("t.name", "t.flag", "t.owner", "entry_id", "entry_type", "t.id")
                .Where("l.tenant_id", TenantID)
                .Where("t.owner", owner.ToString())
                .Where("t.flag", (int)tagType);

            return SelectTagByQuery(q);

        }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:12,代码来源:TagDao.cs


示例20: GetTags

        public IEnumerable<Tag> GetTags(object entryID, FileEntryType entryType, TagType tagType)
        {
            var q = Query("files_tag t")
                .InnerJoin("files_tag_link l", Exp.EqColumns("l.tag_id", "t.id"))
                .Select("t.name", "t.flag", "t.owner", "entry_id", "entry_type", "tag_count", "t.id")
                .Where("l.tenant_id", TenantID)
                .Where("l.entry_type", (int) entryType)
                .Where(Exp.Eq("l.entry_id", MappingID(entryID)))
                .Where("t.flag", (int) tagType);

            return SelectTagByQuery(q);
        }
开发者ID:vlslavik,项目名称:teamlab.v7.5,代码行数:12,代码来源:TagDao.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# TagTypes类代码示例发布时间:2022-05-24
下一篇:
C# TagNode类代码示例发布时间: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