Boo.BooLangService.Intellisense.EntityToTreeNodeConverter.ToTreeNode C# (CSharp) Method

ToTreeNode() public method

public ToTreeNode ( IEntity entity ) : IBooParseTreeNode
entity IEntity
return IBooParseTreeNode
        public IBooParseTreeNode ToTreeNode(IEntity entity)
        {
            if (entity is IType)
                return ToTreeNode((IType)entity);
            if (entity is IProperty)
                return ToTreeNode((IProperty)entity);
            if (entity is IMethod)
                return ToTreeNode((IMethod)entity);
            if (entity is INamespace)
                return ToTreeNode((INamespace)entity);

            // fallback for unhandled types
            return new ClassTreeNode(new EntitySourceOrigin(entity), entity.FullName);
        }

Same methods

EntityToTreeNodeConverter::ToTreeNode ( IMethod method ) : IBooParseTreeNode
EntityToTreeNodeConverter::ToTreeNode ( INamespace @namespace ) : IBooParseTreeNode
EntityToTreeNodeConverter::ToTreeNode ( IProperty property ) : IBooParseTreeNode
EntityToTreeNodeConverter::ToTreeNode ( IType type ) : IBooParseTreeNode

Usage Example

        public IBooParseTreeNode ToTreeNode()
        {
            var converter = new EntityToTreeNodeConverter();

            return converter.ToTreeNode(entity);
        }
EntityToTreeNodeConverter