Exemple #1
0
        public CropFormat AddCropFormat(string name, float width, float height, bool update)
        {
            if (!_isReadonly)
            {
                if (!ContainsCrop(name, width, height) && _crops.Count < Constants.MaxCropsCount)
                {
                    CropFormat format = new CropFormat(_isReadonly, name, width, height, Modified);
                    _crops.Add(format);
                    if (Modified != null)
                    {
                        Modified();
                    }

                    if (update && Updated != null)
                    {
                        Updated();
                    }
                    return(format);
                }
                return(null);
            }
            else
            {
                throw new NotSupportedException();
            }
        }
Exemple #2
0
 public void RemoveCropFormat(CropFormat format)
 {
     if (!_isReadonly)
     {
         if (format != null && _crops.Contains(format))
         {
             _crops.Remove(format);
             if (Modified != null)
             {
                 Modified();
             }
         }
     }
     else
     {
         throw new NotSupportedException();
     }
 }