Пример #1
0
        // Please see ASURT 144034 for this device-specific issue.
        // Internal-only utility to return name of an XhtmlFormatStyleClass that represents the (format) diff of the
        // parameter from the current style. This does not push the style stack -it is used only for tags with
        // small content models such as <a>.
        internal String GetCssFormatClassName(Style style)
        {
            if (!_cachingRendering)
            {
                Debug.Fail("Only call when caching rendering");
                return(null);
            }
            if (style == null)
            {
                return(null); // caller should check for this return value.
            }
            // We need to write all non-default properties, so get the filter from the _defaultStyleClass.
            StyleFilter filter = _defaultStyleClass.GetFilter(style);

            filter &= XhtmlConstants.Format;
            if (filter == StyleFilter.None)
            {
                return(null);
            }
            XhtmlFormatStyleClass styleClass = new XhtmlFormatStyleClass(style, filter);
            // Value returned is a valid styleClass which can be added to the attributes of, e.g., an <a> element
            // to cause character formatting.  Please see 144034 for the device specific issue.
            XhtmlStyleClass hashStyleClass = EnsureXhtmlStyleClassInHashtable(styleClass);

            if (hashStyleClass == null)
            {
                return(null);
            }
            return(hashStyleClass.StyleClassName);
        }
 // Please see ASURT 144034 for this device-specific issue.
 // Internal-only utility to return name of an XhtmlFormatStyleClass that represents the (format) diff of the 
 // parameter from the current style. This does not push the style stack -it is used only for tags with 
 // small content models such as <a>.  
 internal String GetCssFormatClassName(Style style) {
     if (!_cachingRendering) {
         Debug.Fail ("Only call when caching rendering");
         return null;
     }
     if (style ==  null) {
         return null; // caller should check for this return value.
     }
     // We need to write all non-default properties, so get the filter from the _defaultStyleClass.
     StyleFilter filter = _defaultStyleClass.GetFilter(style);
     filter &= XhtmlConstants.Format;
     if (filter == StyleFilter.None) {
         return null;
     }
     XhtmlFormatStyleClass styleClass = new XhtmlFormatStyleClass(style, filter);
     // Value returned is a valid styleClass which can be added to the attributes of, e.g., an <a> element
     // to cause character formatting.  Please see 144034 for the device specific issue.
     XhtmlStyleClass hashStyleClass = EnsureXhtmlStyleClassInHashtable(styleClass);
     if (hashStyleClass == null) {
         return null;
     }
     return hashStyleClass.StyleClassName;
 }