Example #1
0
        public override int ValueFromPoint(Point p)
        {
            CustomRepositoryItem customItem = (CustomRepositoryItem)this.Item;
            int middle         = (customItem.AllowUseMiddleValue) ? customItem.Middle : (customItem.Minimum + customItem.Maximum) / 2;
            int value          = base.ValueFromPoint(p);
            int middleDistance = (customItem.Minimum + customItem.Maximum) / customItem.MiddleDistance;

            if (value >= middle - middleDistance && value <= middle + middleDistance)
            {
                return(middle);
            }
            return(value);
        }
Example #2
0
 public override void Assign(RepositoryItem item)
 {
     base.Assign(item);
     BeginUpdate();
     try {
         base.Assign(item);
         CustomRepositoryItem source = item as CustomRepositoryItem;
         if (source == null)
         {
             return;
         }
         SnapToMiddleValue = source.SnapToMiddleValue;
         MiddleDistance    = source.MiddleDistance;
     }
     finally {
         EndUpdate();
     }
 }
Example #3
0
 static CustomZoomTrackBar()
 {
     CustomRepositoryItem.Register();
 }