Example #1
0
        public bool InsertAt(DisplayValuePair pair, int index)
        {
            if (index < 0 || index > valuePaires.Count)
            {
                return(false);
            }
            if (index == valuePaires.Count)
            {
                valuePaires.Add(pair);
                return(true);
            }

            valuePaires.Insert(index, pair);
            return(true);
        }
Example #2
0
        /// <summary>
        /// 根据扩展参数得到数据集 add by wdp for 危险点关联设备 2013-08-14
        /// </summary>
        /// <param name="extraData"></param>
        /// <returns></returns>
        public List <DisplayValuePair> GetContentByExtraData(string extraData)
        {
            List <DisplayValuePair> ListResult = new List <DisplayValuePair>();

            foreach (DisplayValuePair pair in valuePaires)
            {
                if (string.Compare(pair.ExtraData, extraData, true) == 0)
                {
                    DisplayValuePair p = new DisplayValuePair(pair.DisplayText, pair.Value, pair.ExtraData);
                    ListResult.Add(p);
                }
            }

            return(ListResult);
        }
Example #3
0
 public void Add(DisplayValuePair valuePair)
 {
     valuePaires.Add(valuePair);
 }