Ejemplo n.º 1
0
        /// <summary>
        /// 节点包含到项目中
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void sdsite_ElementInclude(object sender, EventArgs <SimpleExIndexXmlElement> e)
        {
            BaseTreeNode eleNode = null;

            eleNode = this.GetNode(CurrentNode.FullPath);
            int eleIndex = eleNode.Index;

            BaseTreeNode parentNode = eleNode.Parent as BaseTreeNode;

            parentNode.RemoveChildNode(eleNode as BaseTreeNode);
            BaseTreeNode newNode = null;

            switch (e.Item.DataType)
            {
            case DataType.Channel:
                newNode = new ChannelNode(e.Item as ChannelSimpleExXmlElement);
                break;

            case DataType.Tmplt:
                newNode = new TmpltNode(e.Item as TmpltSimpleExXmlElement);
                break;

            case DataType.Page:
                newNode = new PageNode(e.Item as PageSimpleExXmlElement);
                break;

            case DataType.Folder:
            {
                switch (((FolderXmlElement)e.Item).FolderType)
                {
                case FolderType.ChannelFolder:
                    newNode = new ChannelFolderNode(e.Item as FolderXmlElement);
                    break;

                case FolderType.TmpltFolder:
                    newNode = new TmpltFolderNode(e.Item as TmpltFolderXmlElement);
                    break;

                case FolderType.ResourcesFolder:
                    newNode = new ResourceFolderNode(e.Item as FolderXmlElement);
                    break;
                }
                break;
            }

            case DataType.File:
                break;
            }
            //FileOutsideNode fileOutSideNode = new FileOutsideNode(e.Item.AbsoluteFilePath);
            parentNode.AddChildNode(newNode);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 节点排除出项目
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void sdsite_ElementExclude(object sender, EventArgs <SimpleExIndexXmlElement> e)
        {
            ElementNode eleNode  = GetElementNode(e.Item.Id);
            int         eleIndex = eleNode.Index;

            BaseTreeNode parentNode = eleNode.Parent;

            parentNode.RemoveChildNode(eleNode);
            if (ShowAllFiles)
            {
                OutsideNode outSideNode = null;
                if (e.Item is FolderXmlElement)
                {
                    outSideNode = new FileOutsideNode(e.Item.AbsoluteFilePath);
                }
                else
                {
                    outSideNode = new FolderOutsideNode(e.Item.AbsoluteFilePath);
                }
                outSideNode.Text = e.Item.FileName;
                parentNode.Nodes.Insert(eleIndex, outSideNode);
            }
        }