コード例 #1
0
        private void ComputeAcceptedContent()
        {
            if (_panelAcceptedContents.Count == 0)
            {
                return;
            }

            AcceptedContent = _panelAcceptedContents
                              .Select(pc => pc.content)
                              .Aggregate((c1,
                                          c2) => c1 | c2);
        }
コード例 #2
0
        public void Reset()
        {
            ClearContent();

            _panelAcceptedContents.Clear();
            _contentPanelMap.Clear();

            AcceptedContent = ContentTypeFlags.None;
            IsValid         = true;

            _collapsableGrids.Clear();

            SetCurrentValue(ContentProperty, null);
        }
コード例 #3
0
        public static Brush GetColorBrush(this ContentTypeFlags contentFlags)
        {
            List <Color> colors = new List <Color>();

            // Text
            if ((contentFlags & ContentTypeFlags.Text) != ContentTypeFlags.None)
            {
                colors.Add(Colors.Gray.With(c => c.A = 100));
            }

            // Image
            if ((contentFlags & ContentTypeFlags.Image) != ContentTypeFlags.None)
            {
                colors.Add(Colors.LightGreen.With(c => c.A = 100));
            }

            // Sound
            if ((contentFlags & ContentTypeFlags.Sound) != ContentTypeFlags.None)
            {
                colors.Add(Colors.LightBlue.With(c => c.A = 100));
            }

            return(new SolidColorBrush(colors.Aggregate(Color.Add)));
        }
コード例 #4
0
 public static void SetAcceptedContent(DependencyObject d, ContentTypeFlags value)
 {
     d.SetValue(AcceptedContentProperty, value);
 }