/// <summary>
        /// Adds a title for an applicatiopn into the HTML Report
        /// </summary>
        /// <param name="application">The Application to add the title for</param>
        public PermissionReport AddApplicationTitle(EvolutionApplication application)
        {
            var builder = new StringBuilder();
            builder.Append("Permissions for: ");
            builder.Append(application.Name);
            builder.Append(" (");
            builder.Append(application.ApplicationType);
            builder.Append(" #");
            builder.Append(application.Id);
            builder.Append(")");

            AddTitle(builder.ToString());
            if (application.GroupId.HasValue)
                InternalElements.Add(new XElement("p") { Value = "In Group #" + application.GroupId.Value.ToString() });

            return this;
        }
            /// <summary>
            /// Creates a new ApplicationTree Node for the given EvolutionApplication
            /// </summary>
            /// <param name="app">The application</param>
            public ApplicationTreeNode(EvolutionApplication app)
            {
                Application = app;
                Text = app.Name;
                ToolTipText = app.Description;

                // Default the image key to the Application Type
                ImageKey = SelectedImageKey = Application.ApplicationType;
            }
 /// <summary>
 /// Creates a new SelectedApplicationChangedEventArgs object
 /// </summary>
 /// <param name="newApp">The newly selected application</param>
 /// <param name="oldApp">The previously selected application</param>
 public SelectedApplicationChangedEventArgs(EvolutionApplication newApp, EvolutionApplication oldApp)
 {
     NewApplication = newApp;
     OldApplication = oldApp;
 }
        /// <summary>
        /// Event handler fired when a tree node is selected
        /// </summary>
        /// <remarks>Used to set the SelectedApplication property</remarks>
        private void applicationTree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            // Escape if the node is not an Application TreeNode
            var appTreeNode = e.Node as ApplicationTreeNode;
            if (appTreeNode == null)
                return;

            // Prepare the EventArgs
            var oldApplication = SelectedApplication;
            var eventArgs = new SelectedApplicationChangedEventArgs(oldApplication, appTreeNode.Application);

            // Persist the new Application
            SelectedApplication = appTreeNode.Application;
        }