Exemplo n.º 1
0
        public static IEnumerable<string> GetPossibleVendorSpecifics(this AtDirective directive, ICssSchemaInstance schema)
        {
            string text = directive.Keyword.Text;

            foreach (string prefix in VendorHelpers.GetPrefixes(schema).Where(p => p != "-o-")) // Remove -o- since the parser doesn't recognize -o-keyframes
            {
                ICssCompletionListEntry entry = schema.GetAtDirective("@" + prefix + text);
                if (entry != null && string.IsNullOrEmpty(entry.GetAttribute("obsolete")))
                    yield return entry.DisplayText;
            }
        }
Exemplo n.º 2
0
        public static IEnumerable<string> GetPossibleVendorSpecifics(this Declaration declaration, ICssSchemaInstance schema)
        {
            string text = declaration.PropertyName.Text;

            foreach (string prefix in VendorHelpers.GetPrefixes(schema))
            {
                ICssCompletionListEntry entry = schema.GetProperty(prefix + text);
                if (entry != null && string.IsNullOrEmpty(entry.GetAttribute("obsolete")))
                    yield return entry.DisplayText;
            }
        }
Exemplo n.º 3
0
        public static bool TryGetStandardPropertyName(this AtDirective directive, out string standardName, ICssSchemaInstance schema)
        {
            standardName = null;

            string propText = directive.Keyword.Text;
            string prefix = VendorHelpers.GetPrefixes(schema).SingleOrDefault(p => propText.StartsWith(p, StringComparison.Ordinal));
            if (prefix != null)
            {
                standardName = propText.Substring(prefix.Length);
                return true;
            }

            return false;
        }
Exemplo n.º 4
0
        public static bool TryGetStandardPropertyName(this Declaration declaration, out string standardName, ICssSchemaInstance schema)
        {
            standardName = null;

            if (declaration.IsVendorSpecific())
            {
                string propText = declaration.PropertyName.Text;
                string prefix   = VendorHelpers.GetPrefixes(schema).SingleOrDefault(p => propText.StartsWith(p, StringComparison.Ordinal));
                if (prefix != null)
                {
                    standardName = propText.Substring(prefix.Length);
                    return(true);
                }
            }

            return(false);
        }