예제 #1
0
        public CarboProperty GetCarboProperty(string propertyName)
        {
            CarboProperty result = null;

            foreach (CarboProperty cp in Properties)
            {
                if (cp.PropertyName == propertyName)
                {
                    result = cp;
                    break;
                }
            }
            if (result == null)
            {
                result = new CarboProperty();
            }
            return(result);
        }
예제 #2
0
        public void SetProperty(string properyName, string propertyValue)
        {
            CarboProperty cpnew = new CarboProperty
            {
                PropertyName = properyName,
                Value        = propertyValue
            };
            bool isUnique = true;

            foreach (CarboProperty cp in Properties)
            {
                if (cp.PropertyName == cpnew.PropertyName)
                {
                    cp.Value = cpnew.Value;
                    isUnique = false;
                    break;
                }
            }
            if (isUnique == true)
            {
                Properties.Add(cpnew);
            }
        }