//============================================================
        // <T>建立资源目录。</T>
        //============================================================
        protected void BuildResourceNode(FRsResourceGroup group)
        {
            string         label       = "(" + group.Code + ")" + group.Label;
            TreeNode       treeNode    = new TreeNode(label);
            SDsResourceTag resourceTag = group.Tag as SDsResourceTag;

            resourceTag.node = treeNode;
            treeNode.Tag     = group;
            Nodes.Add(treeNode);
            //foreach (INamePair<FRsResource> pair in group.ResourceDictionary) {
            //   FDsResource resource = pair.Value;
            //   TreeNode node = new TreeNode(resource.Label);
            //   if (resource.IsValid) {
            //      node.ForeColor = Color.Black;
            //      node.ImageKey = resource.TypeName;
            //      node.SelectedImageKey = resource.TypeName;
            //   } else {
            //      node.ForeColor = Color.Gray;
            //      node.ImageKey = resource.TypeName + "D";
            //      node.SelectedImageKey = resource.TypeName + "D";
            //   }
            //   node.Tag = resource;
            //   SDsResourceTag tag = resource.Tag as SDsResourceTag;
            //   tag.node = node;
            //   treeNode.Nodes.Add(node);
            //}
        }
Example #2
0
        //============================================================
        // <T>搜索按键按下。</T>
        //
        // @param sender 事件产生者
        // @param      e 数据对象
        //============================================================
        private void cbxSearch_KeyUp(object sender, KeyEventArgs e)
        {
            string value = cbxSearch.Text;

            if (_filterValue == value)
            {
                return;
            }
            // 资源过滤
            lvwResources.BeginUpdate();
            lvwResources.Items.Clear();
            foreach (IIntPair <FRsResource> pair in RContent2dManager.ResourceConsole.Resources)
            {
                FRsResource    resource = pair.Value;
                SDsResourceTag tag      = resource.Tag as SDsResourceTag;
                if (-1 != resource.Keyword.IndexOf(value))
                {
                    lvwResources.Items.Add(tag.item);
                }
            }
            lvwResources.EndUpdate();
            _filterValue = value;
        }
Example #3
0
        //============================================================
        // <T>打开资源信息。</T>
        //============================================================
        public void Open()
        {
            FRsResourceDictionary resourceDictionary = RContent2dManager.ResourceConsole.Resources;

            // 初始化资源附加数据
            foreach (IIntPair <FRsResource> pair in resourceDictionary)
            {
                pair.Value.Tag = new SDsResourceTag();
            }
            // 打开资源目录
            qdsCatalog.Open();
            // 打开资源列表
            lvwResources.BeginUpdate();
            foreach (IIntPair <FRsResource> pair in resourceDictionary)
            {
                FRsResource  resource    = pair.Value;
                ListViewItem lviResource = new ListViewItem(resource.Label);
                if (resource.OptionValid)
                {
                    lviResource.ForeColor = Color.Black;
                    lviResource.ImageKey  = resource.TypeName;
                }
                else
                {
                    lviResource.ForeColor = Color.Gray;
                    lviResource.ImageKey  = resource.TypeName + "D";
                }
                // 设置关联
                SDsResourceTag tag = resource.Tag as SDsResourceTag;
                tag.item        = lviResource;
                lviResource.Tag = resource;
                lvwResources.Items.Add(lviResource);
            }
            lvwResources.EndUpdate();
            // 选择资源
            SelectResource(null);
        }