示例#1
0
        /// <summary>
        /// creates a new XmlTreeNode with the default parameters for the BaseTree root node
        /// </summary>
        /// <param name="bTree"></param>
        /// <returns></returns>
        public static XmlTreeNode CreateRoot(BaseTree bTree)
        {
            XmlTreeNode xNode = new XmlTreeNode();

            xNode.NodeID   = bTree.StartNodeID.ToString();
            xNode.Source   = bTree.GetTreeServiceUrl();
            xNode.Menu     = bTree.RootNodeActions.FindAll(delegate(IAction a) { return(true); });        //return a duplicate copy of the list
            xNode.NodeType = bTree.TreeAlias;
            xNode.Text     = BaseTree.GetTreeHeader(bTree.TreeAlias);

            // By default the action from the trees.config will be used, if none is specified then the apps dashboard will be used.
            var appTreeItem = umbraco.BusinessLogic.ApplicationTree.getByAlias(bTree.TreeAlias);

            xNode.Action = appTreeItem == null || String.IsNullOrEmpty(appTreeItem.Action) ? "javascript:" + ClientTools.Scripts.OpenDashboard(bTree.app) : "javascript:" + appTreeItem.Action;

            xNode.IsRoot = true;
            //generally the tree type and node type are the same but in some cased they are not.
            xNode.m_treeType = bTree.TreeAlias;
            return(xNode);
        }
        /// <summary>
        /// Converts an ITree into a BaseTree. This is used for Legacy trees that don't inherit from BaseTree already.
        /// </summary>
        /// <param name="tree"></param>
        /// <param name="alias"></param>
        /// <param name="appAlias"></param>
        /// <param name="iconClosed"></param>
        /// <param name="iconOpened"></param>
        /// <param name="action"></param>
        /// <returns></returns>
        public static BaseTree FromITree(ITree tree, string alias, string appAlias, string iconClosed, string iconOpened, string action)
        {
            TreeService treeSvc = new TreeService(null, alias, null, null, TreeDialogModes.none, appAlias);
            //create the generic XmlTreeNode and fill it with the properties from the db
            NullTree    nullTree = new NullTree(appAlias);
            XmlTreeNode node     = XmlTreeNode.CreateRoot(nullTree);

            node.Text     = BaseTree.GetTreeHeader(alias);;
            node.Action   = action;
            node.Source   = treeSvc.GetServiceUrl();
            node.Icon     = iconClosed;
            node.OpenIcon = iconOpened;
            node.NodeType = "init" + alias;
            node.NodeType = alias;
            node.NodeID   = "init";
            node.Menu     = BaseTree.GetDefaultRootNodeActions();

            //convert the tree to a LegacyTree
            LegacyTree bTree = new LegacyTree(tree, appAlias, node);

            return(bTree);
        }
示例#3
0
		/// <summary>
		/// creates a new XmlTreeNode with the default parameters for the BaseTree root node
		/// </summary>
		/// <param name="bTree"></param>
		/// <returns></returns>
		public static XmlTreeNode CreateRoot(BaseTree bTree)
		{
			XmlTreeNode xNode = new XmlTreeNode();
			xNode.NodeID = bTree.StartNodeID.ToString();
			xNode.Source = bTree.GetTreeServiceUrl();
			xNode.Menu = bTree.RootNodeActions.FindAll(delegate(IAction a) { return true; }); //return a duplicate copy of the list
			xNode.NodeType = bTree.TreeAlias;
			xNode.Text = BaseTree.GetTreeHeader(bTree.TreeAlias);
			
            // By default the action from the trees.config will be used, if none is specified then the apps dashboard will be used.
            var appTreeItem = umbraco.BusinessLogic.ApplicationTree.getByAlias(bTree.TreeAlias);
            xNode.Action = appTreeItem == null || String.IsNullOrEmpty(appTreeItem.Action) ? "javascript:" + ClientTools.Scripts.OpenDashboard(bTree.app) : "javascript:" + appTreeItem.Action;
			
            xNode.IsRoot = true;
			//generally the tree type and node type are the same but in some cased they are not.
			xNode.m_treeType = bTree.TreeAlias;
			return xNode;
		}
示例#4
0
		/// <summary>
		/// creates a new XmlTreeNode with the default parameters from the BaseTree
		/// </summary>
		/// <param name="bTree"></param>
		/// <returns></returns>
		public static XmlTreeNode Create(BaseTree bTree)
		{
			XmlTreeNode xNode = new XmlTreeNode();
			xNode.Menu = bTree.AllowedActions.FindAll(delegate(IAction a) { return true; }); //return a duplicate copy of the list
			xNode.NodeType = bTree.TreeAlias;
			xNode.Source = string.Empty;
			xNode.IsRoot = false;
			//generally the tree type and node type are the same but in some cased they are not.
			xNode.m_treeType = bTree.TreeAlias;
			return xNode;
		}
示例#5
0
		/// <summary>
		/// creates a new XmlTreeNode with the default parameters for the BaseTree root node
		/// </summary>
		/// <param name="bTree"></param>
		/// <returns></returns>
		public static XmlTreeNode CreateRoot(BaseTree bTree)
		{
			XmlTreeNode xNode = new XmlTreeNode();
			xNode.NodeID = bTree.StartNodeID.ToString();
			xNode.Source = bTree.GetTreeServiceUrl();
			xNode.Menu = bTree.RootNodeActions.FindAll(delegate(IAction a) { return true; }); //return a duplicate copy of the list
			xNode.NodeType = bTree.TreeAlias;
			xNode.Text = BaseTree.GetTreeHeader(bTree.TreeAlias);
			//by default, all root nodes will open the dashboard to their application
			xNode.Action = "javascript:" + ClientTools.Scripts.OpenDashboard(bTree.app);
			xNode.IsRoot = true;
			//generally the tree type and node type are the same but in some cased they are not.
			xNode.m_treeType = bTree.TreeAlias;
			return xNode;
		}
        /// <summary>
        /// Returns a new instance of a BaseTree based on this Tree Definition
        /// </summary>
        public BaseTree CreateInstance()
        {
            //create the tree instance
            ITree typeInstance = CreateTreeInstance(m_treeType, m_app.alias);

            if (typeInstance != null)
            {
                //convert to BaseTree
                return(BaseTree.IsBaseTree(typeInstance) ? typeInstance as BaseTree : BaseTree.FromITree(typeInstance, m_tree.Alias, m_app.alias, m_tree.IconClosed, m_tree.IconOpened, m_tree.Action));
            }
            return(null);
        }
 public loadResultsRaceEntries(BaseTree tree)
     : base(tree)
 {
     _raceRepository = new RaceRepository();
 }
 public loadResultsSeason(BaseTree tree)
     : base(tree)
 {
 }
 public loadResultsEntries(BaseTree tree)
     : base(tree)
 {
 }
 public loadResultsRaceGroup(BaseTree tree)
     : base(tree)
 {
 }
 public loadResultsQualifyingResults(BaseTree tree)
     : base(tree)
 {
 }
 public LoadResultsTreeCommandFactory(BaseTree baseTree)
 {
     _baseTree = baseTree;
 }