Ejemplo n.º 1
0
        private void Initialize(StyleSheet styleSheet)
        {
            var    namespaceSeparatorIndex = Text.IndexOf('|');
            string @namespace = null;
            //string prefix = null;
            string alias   = "";
            string tagName = null;

            if (namespaceSeparatorIndex > -1)
            {
                alias   = Text.Substring(0, namespaceSeparatorIndex);
                tagName = Text.Substring(namespaceSeparatorIndex + 1);

                if (alias != "*")
                {
                    @namespace = styleSheet.GetNamespaceUri(alias, tagName);
                }
                else
                {
                }
            }
            else
            {
                tagName    = Text;
                @namespace = styleSheet.GetNamespaceUri("", tagName);
            }

            this.Alias             = alias;
            this.TagName           = tagName;
            this.NamespaceUri      = @namespace;
            this.initializedWith   = styleSheet;
            this.styleSheetVersion = styleSheet.Version;
            // Hack
            try
            {
                this.ElementTypeInfo = System.Type.GetType(TypeHelpers.ResolveFullTypeName(styleSheet.Namespaces, Text), false)?.GetTypeInfo();
            }
            catch { /* no valid type */ }
        }
Ejemplo n.º 2
0
 public string ResolveFullTypeName(IList <CssNamespace> namespaces, string cssTypeExpression)
 {
     return(TypeHelpers.ResolveFullTypeName(namespaces, cssTypeExpression));
 }