Exemplo n.º 1
0
        private static bool AreColoursEqual(CGColor x, CGColor y)
        {
            if (x == null || y == null)
            {
                throw new ArgumentNullException();
            }

            return(x.ToSKColor().Equals(y.ToSKColor()));
        }
Exemplo n.º 2
0
        public void NotifyBoundingBoxColourDidChange(CGColor previousColour, CGColor changedColour, string category)
        {
            if (previousColour != null)
            {
                RemovePreviousColour(ColoursInUse, previousColour);
            }

            if (ColoursInUse.Contains(changedColour))
            {
                FilteredItems.FirstOrDefault(x => x.Label.Equals(category)).Color = changedColour.ToSKColor();
                ParentResultsViewController.NotifyColourDuplicated(changedColour);
            }
            else
            {
                ColoursInUse.Add(changedColour);
            }
        }
Exemplo n.º 3
0
 partial void ColorCancel_TouchUpInside(UIButton sender)
 {
     // remove all the previewed colour of bounding box and dismiss colour picker popup
     if (_lastTappedColorButton != null)
     {
         _lastTappedColorButton.Layer.ShadowColor   = Constants.ColorPickerPopupUnselectedColour;
         _lastTappedColorButton.Layer.ShadowOpacity = Constants.ClearShadowOpacity;
         foreach (var binding in Observations)
         {
             if (binding.Key.Category.Label != Category.Text)
             {
                 continue;
             }
             binding.Value.Hidden            = true;
             binding.Key.Category.Color      = _originalColour.ToSKColor();
             binding.Value.Layer.BorderColor = _originalColour;
             binding.Value.Hidden            = false;
         }
     }
     DismissModalViewController(false);
 }