internal ITemplate GetTemplateFromText(string text, ITemplate currentTemplate)
        {
            if ((text == null) || (text.Length == 0))
            {
                throw new ArgumentNullException("text");
            }
            IDesignerHost service = (IDesignerHost)base.Component.Site.GetService(typeof(IDesignerHost));

            try
            {
                ITemplate template = ControlParser.ParseTemplate(service, text);
                if (template != null)
                {
                    return(template);
                }
            }
            catch
            {
            }
            return(currentTemplate);
        }
        /// <include file='doc\TemplatedControlDesigner.uex' path='docs/doc[@for="TemplatedControlDesigner.GetTemplateFromText1"]/*' />
        /// <internalonly/>
        internal ITemplate GetTemplateFromText(string text, ITemplate currentTemplate)
        {
            if ((text == null) || (text.Length == 0))
            {
                throw new ArgumentException("text");
            }
            IDesignerHost host = (IDesignerHost)Component.Site.GetService(typeof(IDesignerHost));

            Debug.Assert(host != null, "no IDesignerHost!");

            try {
                ITemplate newTemplate = ControlParser.ParseTemplate(host, text);
                if (newTemplate != null)
                {
                    return(newTemplate);
                }
            }
            catch {
            }
            return(currentTemplate);
        }