private void ShowInternal(bool fShow)
 {
     if ((this.htmlElemFrame != null) && (this.fVisible != fShow))
     {
         try
         {
             System.Design.NativeMethods.IHTMLDOMNode htmlElemFrame = (System.Design.NativeMethods.IHTMLDOMNode) this.htmlElemFrame;
             System.Design.NativeMethods.IHTMLStyle   style         = ((System.Design.NativeMethods.IHTMLElement)htmlElemFrame).GetStyle();
             if (fShow)
             {
                 style.SetDisplay(string.Empty);
             }
             else
             {
                 if (this.templateElements != null)
                 {
                     for (int i = 0; i < this.templateElements.Length; i++)
                     {
                         if (this.templateElements[i] != null)
                         {
                             ((System.Design.NativeMethods.IHTMLElement) this.templateElements[i]).SetInnerHTML(string.Empty);
                         }
                     }
                 }
                 style.SetDisplay("none");
             }
         }
         catch (Exception)
         {
         }
         this.fVisible = fShow;
     }
 }
 private void Initialize()
 {
     if (this.htmlElemFrame == null)
     {
         try
         {
             object obj2;
             this.htmlElemFrame = this.htmlElemParent.GetDocument().CreateElement("SPAN");
             this.htmlElemFrame.SetInnerHTML(this.Content);
             System.Design.NativeMethods.IHTMLDOMNode htmlElemFrame = (System.Design.NativeMethods.IHTMLDOMNode) this.htmlElemFrame;
             if (htmlElemFrame != null)
             {
                 this.htmlElemContent = (System.Design.NativeMethods.IHTMLElement)htmlElemFrame.GetFirstChild();
             }
             System.Design.NativeMethods.IHTMLElement3 element = (System.Design.NativeMethods.IHTMLElement3) this.htmlElemFrame;
             if (element != null)
             {
                 element.SetContentEditable("false");
             }
             this.templateElements = new object[this.templateNames.Length];
             object index = 0;
             System.Design.NativeMethods.IHTMLElementCollection all = (System.Design.NativeMethods.IHTMLElementCollection) this.htmlElemFrame.GetAll();
             for (int i = 0; i < this.templateNames.Length; i++)
             {
                 try
                 {
                     obj2 = this.templateNames[i];
                     System.Design.NativeMethods.IHTMLElement element2 = all.Item(obj2, index);
                     element2.SetAttribute("templatename", obj2, 0);
                     string p = "<DIV contentEditable=\"true\" style=\"padding:1;height:100%;width:100%\"></DIV>";
                     element2.SetInnerHTML(p);
                     System.Design.NativeMethods.IHTMLDOMNode node2 = (System.Design.NativeMethods.IHTMLDOMNode)element2;
                     if (node2 != null)
                     {
                         this.templateElements[i] = node2.GetFirstChild();
                     }
                 }
                 catch (Exception)
                 {
                     this.templateElements[i] = null;
                 }
             }
             obj2 = "idControlName";
             this.htmlElemControlName = all.Item(obj2, index);
             obj2 = "idFrameName";
             object obj4 = all.Item(obj2, index);
             if (obj4 != null)
             {
                 ((System.Design.NativeMethods.IHTMLElement)obj4).SetInnerText(this.frameName);
             }
             System.Design.NativeMethods.IHTMLDOMNode htmlElemParent = (System.Design.NativeMethods.IHTMLDOMNode) this.htmlElemParent;
             if (htmlElemParent != null)
             {
                 htmlElemParent.AppendChild(htmlElemFrame);
             }
         }
         catch (Exception)
         {
         }
     }
 }