Ejemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="infoTuple1"></param>
        /// <param name="infoTuple2"></param>
        public TowInfoTuple(InfoItem[] infoTuple1, InfoItem[] infoTuple2)
        {
            this.InfoTuple1 = infoTuple1;
            this.InfoTuple2 = infoTuple2;

            bool infoValue1IsNullOrEmpty = infoTuple1 == null || infoTuple1.Length == 0;
            bool infoValue2IsNullOrEmpty = infoTuple2 == null || infoTuple2.Length == 0;
            BothHasValue = !infoValue1IsNullOrEmpty && !infoValue2IsNullOrEmpty;
            BothNoValue = infoValue1IsNullOrEmpty && infoValue2IsNullOrEmpty;
            HasValue = !infoValue1IsNullOrEmpty || !infoValue2IsNullOrEmpty;
            if (!BothHasValue && !BothNoValue)
            {
                if (infoValue1IsNullOrEmpty)
                {
                    _singleValue = InfoTuple2;
                }
                else
                {
                    _singleValue = InfoTuple1;
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 构建信息元素。
 /// </summary>
 /// <param name="idItems"></param>
 /// <param name="valueItems"></param>
 public InfoTuplePair(InfoItem[] idItems, InfoItem[] valueItems)
 {
     this.IdTuple = idItems ?? new InfoItem[0];
     this.ValueTuple = valueItems ?? new InfoItem[0];
 }