// Token: 0x06003C05 RID: 15365 RVA: 0x00114FA8 File Offset: 0x001131A8
        private static bool AreBrushesEqual(Brush brush1, Brush brush2)
        {
            SolidColorBrush solidColorBrush = brush1 as SolidColorBrush;

            if (solidColorBrush != null)
            {
                return(solidColorBrush.Color.Equals(((SolidColorBrush)brush2).Color));
            }
            string stringValue  = DPTypeDescriptorContext.GetStringValue(TextElement.BackgroundProperty, brush1);
            string stringValue2 = DPTypeDescriptorContext.GetStringValue(TextElement.BackgroundProperty, brush2);

            return(stringValue != null && stringValue2 != null && stringValue == stringValue2);
        }
예제 #2
0
        private static bool AreBrushesEqual(Brush brush1, Brush brush2)
        {
            SolidColorBrush solidBrush1 = brush1 as SolidColorBrush;

            if (solidBrush1 != null)
            {
                return(solidBrush1.Color.Equals(((SolidColorBrush)brush2).Color));
            }
            else
            {
                // When the brush is not serializable to string, we consider values equal only is they are equal as objects
                string string1 = DPTypeDescriptorContext.GetStringValue(TextElement.BackgroundProperty, brush1);
                string string2 = DPTypeDescriptorContext.GetStringValue(TextElement.BackgroundProperty, brush2);
                return(string1 != null && string2 != null ? string1 == string2 : false);
            }
        }