コード例 #1
0
ファイル: QUiDesign.cs プロジェクト: whztt07/MoCross
 //============================================================
 // <T>打开资源信息。</T>
 //============================================================
 public void Open()
 {
     // 初始化界面附加数据
     foreach (FNamePair <FRcFrame> pair in RContent2dManager.FrameConsole.Frames)
     {
         FRcFrame frame = pair.Value;
         frame.LinkerNode = new SUiResourceTag();
     }
     // 打开资源列表
     lvwResources.BeginUpdate();
     foreach (FNamePair <FRcFrame> pair in RContent2dManager.FrameConsole.Frames)
     {
         FRcFrame frame = pair.Value;
         // 创建列表
         ListViewItem lviResource = new ListViewItem(frame.Format());
         lviResource.ForeColor = Color.Black;
         lviResource.ImageKey  = frame.TypeName;
         // 创建信息
         SUiResourceTag tag = new SUiResourceTag();
         tag.frameResource = frame;
         tag.item          = lviResource;
         // 存储关联
         frame.LinkerNode = tag;
         lviResource.Tag  = tag;
         lvwResources.Items.Add(lviResource);
     }
     lvwResources.EndUpdate();
     // 选择资源
     SelectResource(null);
 }
コード例 #2
0
ファイル: QUiDesign.cs プロジェクト: whztt07/MoCross
        //============================================================
        // <T>搜索按键按下。</T>
        //
        // @param sender 事件产生者
        // @param      e 数据对象
        // @author TYFNG 20120406
        //============================================================
        private void cbxSearch_KeyUp(object sender, KeyEventArgs e)
        {
            string value = cbxSearch.Text.ToLower();

            if (_filterValue == value)
            {
                return;
            }
            // 资源过滤
            lvwResources.BeginUpdate();
            lvwResources.Items.Clear();
            foreach (FNamePair <FRcFrame> pair in RContent2dManager.FrameConsole.Frames)
            {
                FRcFrame       frame  = pair.Value;
                string         format = frame.Format().ToLower();
                SUiResourceTag tag    = frame.LinkerNode as SUiResourceTag;
                if (tag != null)
                {
                    if (-1 != format.IndexOf(value))
                    {
                        lvwResources.Items.Add(tag.item);
                    }
                }
            }
            lvwResources.EndUpdate();
            _filterValue = value;
        }
コード例 #3
0
ファイル: QUiDesign.cs プロジェクト: whztt07/MoCross
        //============================================================
        // <T>选中资源。</T>
        //============================================================
        protected void SelectResource(object value)
        {
            SUiResourceTag tag = value as SUiResourceTag;

            panInfo.SuspendLayout();
            // 全部隐藏
            qDsUiProperty.Visible = false;
            if (tag != null)
            {
                qDsUiProperty.LoadResource(tag.frameResource);
                qDsUiProperty.Visible = true;
            }
            panInfo.ResumeLayout();
        }
コード例 #4
0
ファイル: QUiDesign.cs プロジェクト: whztt07/MoCross
 //============================================================
 // <T>资源双击处理。</T>
 //
 // @param sender 事件产生者
 // @param e 事件对象
 //============================================================
 private void lvwResources_DoubleClick(object sender, System.EventArgs e)
 {
     if (lvwResources.SelectedItems.Count == 1)
     {
         ListViewItem item = lvwResources.SelectedItems[0];
         if (item != null)
         {
             SUiResourceTag tag = item.Tag as SUiResourceTag;
             if (tag != null)
             {
                 // 打开容器
                 FRcFrame frame = tag.frameResource;
                 frame.Open();
                 // 弹出画面
                 QUiDesignForm frameForm = RDesign2dManager.FrameConsole.OpenDesignForm(frame.Name);
                 frameForm.Show();
             }
         }
     }
 }