Example #1
0
        public Category(Category parentNode, string id,string title,string hasPrivilege,string warnMessage)
        { 
            this.id=id;
            this.title = title;
            if (hasPrivilege == "true") {
                this.hasPrivilege = true;
            } else {
                this.hasPrivilege = false;
            }
	        this.warnMessage = warnMessage;
            this.childCategorys = new List<Category>();
            if (parentNode != null)
            {
                this.applyParent(parentNode);
            }
            if (parentNode != null)
            {
                if (string.IsNullOrEmpty(parentNode.longTitle))
                {
                    this.longTitle =  title;
                }
                else
                {
                    this.longTitle = parentNode.longTitle + " -> " + title;
                }
            }
        }
Example #2
0
	    public void addChild(Category node )
        {
		    this.childCategorys.Add( node );
	    }
Example #3
0
        public void applyParent(Category parentNode )
        {		
	        this.parentNode = parentNode;
		    this.parentNode.addChild( this );
	    }