public void ExitTemplateMode(bool fSwitchingTemplates, bool fNested, bool fSave)
 {
     try
     {
         this.ExitNestedTemplates(fSave);
         this.ActiveTemplateEditingFrame.Close(fSave);
         if (!fSwitchingTemplates)
         {
             this._currentTemplateGroup = null;
             this.RaiseTemplateModeChanged();
             if (!fNested)
             {
                 this.UpdateDesignTimeHtml();
                 TypeDescriptor.Refresh(base.Component);
                 IWebFormsDocumentService service = (IWebFormsDocumentService)this.GetService(typeof(IWebFormsDocumentService));
                 if (service != null)
                 {
                     service.UpdateSelection();
                 }
             }
         }
     }
     catch
     {
     }
 }
 protected override void OnBehaviorAttached()
 {
     if (this.InTemplateModeInternal)
     {
         this.ActiveTemplateEditingFrame.Close(false);
         this.ActiveTemplateEditingFrame.Dispose();
         this._currentTemplateGroup = null;
         TypeDescriptor.Refresh(base.Component);
     }
     base.OnBehaviorAttached();
 }
 public void EnterTemplateMode(ITemplateEditingFrame newTemplateEditingFrame)
 {
     if ((this.ActiveTemplateEditingFrame != newTemplateEditingFrame) && (this.BehaviorInternal != null))
     {
         IControlDesignerBehavior behaviorInternal = (IControlDesignerBehavior)this.BehaviorInternal;
         try
         {
             bool fSwitchingTemplates = false;
             if (this.InTemplateModeInternal)
             {
                 fSwitchingTemplates = true;
                 this.ExitTemplateModeInternal(fSwitchingTemplates, false, true);
             }
             else if (behaviorInternal != null)
             {
                 behaviorInternal.DesignTimeHtml = string.Empty;
             }
             this._currentTemplateGroup = (TemplatedControlDesignerTemplateGroup)this.TemplateGroupTable[newTemplateEditingFrame];
             if (this._currentTemplateGroup == null)
             {
                 this._currentTemplateGroup = new TemplatedControlDesignerTemplateGroup(null, newTemplateEditingFrame);
             }
             if (!fSwitchingTemplates)
             {
                 this.RaiseTemplateModeChanged();
             }
             this.ActiveTemplateEditingFrame.Open();
             base.IsDirtyInternal = true;
             TypeDescriptor.Refresh(base.Component);
         }
         catch
         {
         }
         IWebFormsDocumentService service = (IWebFormsDocumentService)this.GetService(typeof(IWebFormsDocumentService));
         if (service != null)
         {
             service.UpdateSelection();
         }
     }
 }
 public void EnterTemplateMode(ITemplateEditingFrame newTemplateEditingFrame)
 {
     if ((this.ActiveTemplateEditingFrame != newTemplateEditingFrame) && (this.BehaviorInternal != null))
     {
         IControlDesignerBehavior behaviorInternal = (IControlDesignerBehavior) this.BehaviorInternal;
         try
         {
             bool fSwitchingTemplates = false;
             if (this.InTemplateModeInternal)
             {
                 fSwitchingTemplates = true;
                 this.ExitTemplateModeInternal(fSwitchingTemplates, false, true);
             }
             else if (behaviorInternal != null)
             {
                 behaviorInternal.DesignTimeHtml = string.Empty;
             }
             this._currentTemplateGroup = (TemplatedControlDesignerTemplateGroup) this.TemplateGroupTable[newTemplateEditingFrame];
             if (this._currentTemplateGroup == null)
             {
                 this._currentTemplateGroup = new TemplatedControlDesignerTemplateGroup(null, newTemplateEditingFrame);
             }
             if (!fSwitchingTemplates)
             {
                 this.RaiseTemplateModeChanged();
             }
             this.ActiveTemplateEditingFrame.Open();
             base.IsDirtyInternal = true;
             TypeDescriptor.Refresh(base.Component);
         }
         catch
         {
         }
         IWebFormsDocumentService service = (IWebFormsDocumentService) this.GetService(typeof(IWebFormsDocumentService));
         if (service != null)
         {
             service.UpdateSelection();
         }
     }
 }
 protected override void OnBehaviorAttached()
 {
     if (this.InTemplateModeInternal)
     {
         this.ActiveTemplateEditingFrame.Close(false);
         this.ActiveTemplateEditingFrame.Dispose();
         this._currentTemplateGroup = null;
         TypeDescriptor.Refresh(base.Component);
     }
     base.OnBehaviorAttached();
 }
 public void ExitTemplateMode(bool fSwitchingTemplates, bool fNested, bool fSave)
 {
     try
     {
         this.ExitNestedTemplates(fSave);
         this.ActiveTemplateEditingFrame.Close(fSave);
         if (!fSwitchingTemplates)
         {
             this._currentTemplateGroup = null;
             this.RaiseTemplateModeChanged();
             if (!fNested)
             {
                 this.UpdateDesignTimeHtml();
                 TypeDescriptor.Refresh(base.Component);
                 IWebFormsDocumentService service = (IWebFormsDocumentService) this.GetService(typeof(IWebFormsDocumentService));
                 if (service != null)
                 {
                     service.UpdateSelection();
                 }
             }
         }
     }
     catch
     {
     }
 }