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


C# ITreeAdaptor.GetNodeText方法代码示例

本文整理汇总了C#中ITreeAdaptor.GetNodeText方法的典型用法代码示例。如果您正苦于以下问题:C# ITreeAdaptor.GetNodeText方法的具体用法?C# ITreeAdaptor.GetNodeText怎么用?C# ITreeAdaptor.GetNodeText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITreeAdaptor的用法示例。


在下文中一共展示了ITreeAdaptor.GetNodeText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetNodeText

 protected virtual string GetNodeText( ITreeAdaptor adaptor, object t )
 {
     string text = adaptor.GetNodeText(t);
     string uniqueName = "n" + GetNodeNumber( t );
     return string.Format( NodeFormat, uniqueName, FixString( text ) );
 }
开发者ID:jjchaverra,项目名称:antlr3,代码行数:6,代码来源:DotTreeGenerator.cs

示例2: _Equals

		protected static bool _Equals(object t1, object t2, ITreeAdaptor adaptor)
		{
			// make sure both are non-null
			if (t1 == null || t2 == null)
			{
				return false;
			}
			// check roots
			if (adaptor.GetNodeType(t1) != adaptor.GetNodeType(t2))
			{
				return false;
			}
			if (!adaptor.GetNodeText(t1).Equals(adaptor.GetNodeText(t2)))
			{
				return false;
			}
			// check children
			int n1 = adaptor.GetChildCount(t1);
			int n2 = adaptor.GetChildCount(t2);
			if (n1 != n2)
			{
				return false;
			}
			for (int i = 0; i < n1; i++)
			{
				object child1 = adaptor.GetChild(t1, i);
				object child2 = adaptor.GetChild(t2, i);
				if (!_Equals(child1, child2, adaptor))
				{
					return false;
				}
			}
			return true;
		}
开发者ID:Fedorm,项目名称:core-master,代码行数:34,代码来源:TreeWizard.cs

示例3: DefineEdges

        protected virtual IEnumerable<string> DefineEdges( object tree, ITreeAdaptor adaptor )
        {
            if ( tree == null )
                yield break;

            int n = adaptor.GetChildCount( tree );
            if ( n == 0 )
            {
                // must have already dumped as child from previous
                // invocation; do nothing
                yield break;
            }

            string parentName = "n" + GetNodeNumber( tree );

            // for each child, do a parent -> child edge using unique node names
            string parentText = adaptor.GetNodeText( tree );
            for ( int i = 0; i < n; i++ )
            {
                object child = adaptor.GetChild( tree, i );
                string childText = adaptor.GetNodeText(child);
                string childName = "n" + GetNodeNumber( child );
                yield return string.Format( EdgeFormat, parentName, childName, FixString( parentText ), FixString( childText ) );
                foreach ( var t in DefineEdges( child, adaptor ) )
                    yield return t;
            }
        }
开发者ID:jjchaverra,项目名称:antlr3,代码行数:27,代码来源:DotTreeGenerator.cs


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