示例#1
0
        public string GetText(SortInfoQueue sortList)
        {
            string values = null;

            if (sortList == null || sortList.Count <= 0)
            {
                values = Text;
            }
            else
            {
                foreach (SortInfo item in sortList)
                {
                    object objValue = PublicMethods.GetPropertyValue(this, item.Type.ToString());
                    if (objValue == null)
                    {
                        continue;
                    }
                    string strValue = objValue.ToString().Trim();
                    if (string.IsNullOrEmpty(strValue))
                    {
                        continue;
                    }
                    if (!string.IsNullOrEmpty(values))
                    {
                        values += " " + sortList.Separator + " ";
                    }
                    values += strValue;
                }
            }

            return(values);
        }
示例#2
0
 private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     if (ItemChecked != null)
     {
         SortInfoQueue lstSortInfo = GetSortInfoQueue(this.checkedListBox1, e.Index);
         ItemChecked(lstSortInfo, e);
     }
 }
示例#3
0
        void uctSort1_ItemChecked(object sender, ItemCheckEventArgs e)
        {
            SortInfoQueue siQueue = sender as SortInfoQueue;

            if (siQueue != null)
            {
                lblContent.Text = GetExampleString(siQueue);
            }
        }
示例#4
0
        //获取标题名称
        private string GetText(IEntityData entity, SortInfoQueue SortList)
        {
            IAssetsData assetsData = entity as IAssetsData;

            if (assetsData == null)
            {
                return(entity.Text);
            }
            return(assetsData.GetText(SortList));
        }
示例#5
0
 private void btnSure_Click(object sender, EventArgs e)
 {
     sortInfoQueue = uctSort1.GetLstSortInfo <SortInfo, SortInfoQueue>();
     if (sortInfoQueue.Count <= 0)
     {
         PublicMethods.WarnMessageBox(this, "当前选择显示内容不能为空!");
         return;
     }
     sortInfoQueue.Separator = comboBox1.Text;
     this.DialogResult       = System.Windows.Forms.DialogResult.OK;
 }
示例#6
0
        public void UpdateItems(SortInfoQueue sortInfoQueue)
        {
            Dictionary <string, string> dictPropertyName = sortInfoQueue.GetDictPropertyName();

            this.SuspendLayout();
            foreach (KeyValuePair <string, TreeListViewItem> item in dictItems)
            {
                UpdateTreeListViewItem(item.Value, dictPropertyName);
            }
            this.ResumeLayout();
        }
示例#7
0
        private void SubUpdateItems(TreeNode treeNode, SortInfoQueue sortInfoQueue)
        {
            IAssetsData assetsData = treeNode.Tag as IAssetsData;

            if (assetsData != null)
            {
                treeNode.Text = assetsData.GetText(sortInfoQueue);
            }

            foreach (TreeNode item in treeNode.Nodes)
            {
                SubUpdateItems(item, sortInfoQueue);
            }
        }
示例#8
0
        private string GetExampleString(SortInfoQueue sortInfoQueue)
        {
            string result = null;

            foreach (SortInfo item in sortInfoQueue)
            {
                if (!string.IsNullOrEmpty(result))
                {
                    result += " " + comboBox1.Text + " ";
                }
                result += EnumAttrDict <SortType, SortAttribute> .Instance.GetAttribute(item.Type).Description;
            }

            return(result);
        }
示例#9
0
        public void UpdateItems(SortInfoQueue sortInfoQueue)
        {
            this.BeginUpdate();
            this.SuspendLayout();
            //方式一:遍历字典,缺点:界面闪烁
            //foreach (KeyValuePair<string, TreeNode> item in dictNodes)
            //{
            //    TreeNode treeNode = item.Value;
            //    IAssetsData assetsData = treeNode.Tag as IAssetsData;
            //    if (assetsData != null)
            //        treeNode.Text = assetsData.GetText(sortInfoQueue);
            //}

            //方式二:遍历节点
            foreach (TreeNode item in this.Nodes)
            {
                SubUpdateItems(item, sortInfoQueue);
            }

            this.ResumeLayout();
            this.EndUpdate();
        }
示例#10
0
        //因为checkedListBox1仅有选中前发生事件(ItemCheck)没有选中后发生事件,所以要针对当前选中的Item进行反向处理
        private SortInfoQueue GetSortInfoQueue(CheckedListBox checkedListBox1, int curIndex)
        {
            SortInfoQueue lstSortCategory = new SortInfoQueue();

            for (int i = 0; i < checkedListBox1.Items.Count; i++)
            {
                bool bolChecked = checkedListBox1.GetItemChecked(i);
                //如果是
                if (i == curIndex)
                {
                    bolChecked = !bolChecked;
                }

                //如果没有选中
                if (bolChecked == false)
                {
                    continue;
                }
                lstSortCategory.Add(checkedListBox1.Items[i] as SortInfo);
            }

            return(lstSortCategory);
        }
示例#11
0
 private string GetExampleString()
 {
     sortInfoQueue = uctSort1.GetLstSortInfo <SortInfo, SortInfoQueue>();
     return(GetExampleString(sortInfoQueue));
 }
示例#12
0
 public FrmAssetsSort(SortInfoQueue sortInfoQueue)
 {
     InitializeComponent();
     this.sortInfoQueue = sortInfoQueue;
 }
示例#13
0
 private void SubUpdateItems(TreeListViewItem tlvi, SortInfoQueue sortInfoQueue)
 {
 }