コード例 #1
0
        internal void ApplyShorthandProperty(StylePropertyReader reader)
        {
            switch (reader.propertyID)
            {
            case StylePropertyID.BorderColor:
                ShorthandApplicator.ApplyBorderColor(reader, this);
                break;

            case StylePropertyID.BorderRadius:
                ShorthandApplicator.ApplyBorderRadius(reader, this);
                break;

            case StylePropertyID.BorderWidth:
                ShorthandApplicator.ApplyBorderWidth(reader, this);
                break;

            case StylePropertyID.Flex:
                ShorthandApplicator.ApplyFlex(reader, this);
                break;

            case StylePropertyID.Margin:
                ShorthandApplicator.ApplyMargin(reader, this);
                break;

            case StylePropertyID.Padding:
                ShorthandApplicator.ApplyPadding(reader, this);
                break;

            default:
                throw new ArgumentException(string.Format("Non exhaustive switch statement (value={0})", reader.propertyID));
            }
        }
コード例 #2
0
        internal void ApplyShorthandProperty(StyleSheet sheet, StylePropertyID propertyID, StyleValueHandle[] handles, int specificity)
        {
            switch (propertyID)
            {
            case StylePropertyID.BorderColor:
                ShorthandApplicator.ApplyBorderColor(sheet, handles, specificity, this);
                break;

            case StylePropertyID.BorderRadius:
                ShorthandApplicator.ApplyBorderRadius(sheet, handles, specificity, this);
                break;

            case StylePropertyID.BorderWidth:
                ShorthandApplicator.ApplyBorderWidth(sheet, handles, specificity, this);
                break;

            case StylePropertyID.Flex:
                ShorthandApplicator.ApplyFlex(sheet, handles, specificity, this);
                break;

            case StylePropertyID.Margin:
                ShorthandApplicator.ApplyMargin(sheet, handles, specificity, this);
                break;

            case StylePropertyID.Padding:
                ShorthandApplicator.ApplyPadding(sheet, handles, specificity, this);
                break;

            default:
                throw new ArgumentException(string.Format("Non exhaustive switch statement (value={0})", propertyID));
            }
        }