コード例 #1
0
    private StringSegment GetShortName(IntermediateNode node)
    {
        var typeName = node.GetType().Name;

        return
            (typeName.EndsWith(nameof(IntermediateNode), StringComparison.Ordinal) ?
             new StringSegment(typeName, 0, typeName.Length - nameof(IntermediateNode).Length) :
             typeName);
    }
コード例 #2
0
        protected void WriteName(IntermediateNode node)
        {
            var typeName = node.GetType().Name;

            if (typeName.EndsWith("IntermediateNode"))
            {
                _writer.Write(typeName.Substring(0, typeName.Length - "IntermediateNode".Length));
            }
            else
            {
                _writer.Write(typeName);
            }
        }