コード例 #1
0
        public static ControlBuilder ParseTheme(IDesignerHost host, string theme, string themePath)
        {
            try {
                TemplateParser parser = new DesignTimePageThemeParser(themePath);
                parser.FInDesigner            = true;
                parser.DesignerHost           = host;
                parser.ThrowOnFirstParseError = true;

                parser.Text = theme;
                parser.Parse();

                return(parser.RootBuilder);
            } catch (Exception e) {
                throw new Exception(SR.GetString(SR.DesignTimeTemplateParser_ErrorParsingTheme) + " " + e.Message);
            }
        }
コード例 #2
0
        public static ControlBuilder ParseTheme(IDesignerHost host, string theme, string themePath)
        {
            ControlBuilder rootBuilder;

            try
            {
                TemplateParser parser = new DesignTimePageThemeParser(themePath)
                {
                    FInDesigner            = true,
                    DesignerHost           = host,
                    ThrowOnFirstParseError = true,
                    Text = theme
                };
                parser.Parse();
                rootBuilder = parser.RootBuilder;
            }
            catch (Exception exception)
            {
                throw new Exception(System.Web.SR.GetString("DesignTimeTemplateParser_ErrorParsingTheme") + " " + exception.Message);
            }
            return(rootBuilder);
        }
コード例 #3
0
        public static ControlBuilder ParseTheme(IDesignerHost host, string theme, string themePath) {
            try {
                TemplateParser parser = new DesignTimePageThemeParser(themePath);
                parser.FInDesigner = true;
                parser.DesignerHost = host;
                parser.ThrowOnFirstParseError = true;
                
                parser.Text = theme;
                parser.Parse();

                return parser.RootBuilder;
            } catch (Exception e) {
                throw new Exception(SR.GetString(SR.DesignTimeTemplateParser_ErrorParsingTheme) + " " + e.Message);
            }
        }