/// <summary>
        /// 如果目标集合中不存在,则添加一项
        /// </summary>
        /// <param name="pvc"></param>
        /// <param name="cpvc"></param>
        public void ServerToClient(IEnumerable <PropertyValue> pvc, ClientPropertyValueCollection cpvc)
        {
            pvc.NullCheck("pvc");
            cpvc.NullCheck("cpvc");

            foreach (PropertyValue pv in pvc)
            {
                ClientPropertyValue cpv = cpvc[pv.Definition.Name];

                if (cpv == null)
                {
                    cpv = new ClientPropertyValue(pv.Definition.Name);
                    cpvc.Add(cpv);
                }
                ClientPropertyValueConverter.Instance.ServerToClient(pv, cpv);
            }
        }
Ejemplo n.º 2
0
        public static void CopyTo(this SchemaPropertyValueCollection pcProperties, ClientPropertyValueCollection clientProperties)
        {
            pcProperties.NullCheck("pcProperties");

            pcProperties.ForEach(pcpv => clientProperties.Add(pcpv.ToClientPropertyValue()));
        }
		public static void CopyTo(this SchemaPropertyValueCollection pcProperties, ClientPropertyValueCollection clientProperties)
		{
			pcProperties.NullCheck("pcProperties");

			pcProperties.ForEach(pcpv => clientProperties.Add(pcpv.ToClientPropertyValue()));
		}
        /// <summary>
        /// 如果目标集合中不存在,则添加一项
        /// </summary>
        /// <param name="pvc"></param>
        /// <param name="cpvc"></param>
        public void ServerToClient(IEnumerable<PropertyValue> pvc, ClientPropertyValueCollection cpvc)
        {
            pvc.NullCheck("pvc");
            cpvc.NullCheck("cpvc");

            foreach (PropertyValue pv in pvc)
            {
                ClientPropertyValue cpv = cpvc[pv.Definition.Name];

                if (cpv == null)
                {
                    cpv = new ClientPropertyValue(pv.Definition.Name);
                    cpvc.Add(cpv);
                }
                ClientPropertyValueConverter.Instance.ServerToClient(pv, cpv);
            }
        }