/// <summary>
 /// <para>Closes the application configuration.</para>
 /// </summary>
 /// <param name="node">
 /// <para>The node to execute the command upon.</para>
 /// </param>
 protected override void ExecuteCore(ConfigurationNode node)
 {
     try
     {
         UIService.BeginUpdate();
         if (UIService.IsDirty(node.Hierarchy))
         {
             DialogResult result = UIService.ShowMessage(SR.SaveApplicationRequest, SR.SaveApplicationCaption, MessageBoxButtons.YesNo);
             if (DialogResult.Yes == result)
             {
                 if (!TryAndSaveApplication(node))
                 {
                     return;
                 }
             }
         }
         if (ConfigurationErrorLogService.ConfigurationErrors.Count > 0)
         {
             UIService.DisplayErrorLog(ConfigurationErrorLogService);
             DialogResult result = UIService.ShowMessage(SR.SaveApplicationErrorRequestMessage, SR.SaveApplicationCaption, MessageBoxButtons.YesNo);
             if (result == DialogResult.No)
             {
                 return;
             }
         }
         UIHierarchyService.RemoveHierarchy(node.Hierarchy.Id);
     }
     finally
     {
         UIService.EndUpdate();
     }
 }
 /// <summary>
 /// <para>Removes the <see cref="IUIHierarchy"/> (<see cref="ApplicationConfigurationNode"/> from the <see cref="IUIHierarchyService"/>.</para>
 /// </summary>
 /// <param name="node">
 /// <para>The node to execute the command upon.</para>
 /// </param>
 protected override void ExecuteCore(ConfigurationNode node)
 {
     Debug.Assert(node.GetType().Equals(typeof(ApplicationConfigurationNode)), "Expected an ApplicationConfigurationNode");
     UIHierarchyService.RemoveHierarchy(node.Hierarchy.Id);
 }