/// <summary>
        /// Event handler for the SelectedApplicationChanged event of
        /// the ApplicationSelector control
        /// </summary>
        private void applicationSelector_SelectedApplicationChanged(object sender, SelectedApplicationChangedEventArgs e)
        {
            var application = applicationSelector.SelectedApplication;

            permissionDisplay.CurrentApplication = application;
            permissionDisplayGroupBox.Visible = (application != null);
        }
        /// <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;
        }