예제 #1
0
        /// <summary>
        /// 获取集合的交集
        /// </summary>
        /// <returns>集合</returns>
        public static List <String> getUnionProperties(List <FCView> controls)
        {
            List <String>            unionProperites = new List <String>();
            Dictionary <String, int> propertyNames   = new Dictionary <String, int>();
            int targetsSize = controls.Count;

            for (int i = 0; i < targetsSize; i++)
            {
                FCView        target    = controls[i];
                List <String> pList     = target.getPropertyNames();
                int           pListSize = pList.Count;
                for (int j = 0; j < pListSize; j++)
                {
                    String pName = pList[j];
                    if (!propertyNames.ContainsKey(pName))
                    {
                        propertyNames[pName] = 1;
                    }
                    else
                    {
                        propertyNames[pName] = propertyNames[pName] + 1;
                    }
                }
            }
            foreach (String key in propertyNames.Keys)
            {
                if (propertyNames[key] == targetsSize)
                {
                    unionProperites.Add(key);
                }
            }
            propertyNames.Clear();
            return(unionProperites);
        }