示例#1
0
        public bool DeleteLense(string lense)
        {
            var item = Lenses.Find(l => (l.Name == lense));

            if (item != null)
            {
                Lenses.Remove(item);
                return(true);
            }
            return(false);
        }
示例#2
0
        public bool AddLense(Lense newLense)
        {
            var lense = Lenses.Find(l => (l.Factor == newLense.Factor));

            if (lense == null)
            {
                //create a new lense
                Lenses.Add(newLense);
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#3
0
 public Lense GetLense(string lense)
 {
     return(Lenses.Find(l => (l.ToString() == lense)));
 }