/// <summary>
        /// Loads the views for the corresponding server object.
        /// </summary>
        /// <param name="serverObject">A server object representing a database.</param>
        /// <param name="viewNames">A collection of all the user view names contained in the database.</param>
        public void LoadDatabaseViewsUI(ServerObject serverObject, IEnumerable <string> viewNames)
        {
            var viewsNode = (TreeViewItem)serverObject.Control;

            viewsNode.Items.Clear();

            foreach (var viewName in viewNames)
            {
                viewsNode.Items.Add(GetTreeViewItem(viewName, "Images/table_sql_view.png", ServerObjectType.View));
            }
        }
        /// <summary>
        /// Loads the tables for the corresponding server object.
        /// </summary>
        /// <param name="serverObject">A server object representing a database.</param>
        /// <param name="tableNames">A collection of all the user tables names contained in the database.</param>
        public void LoadDatabaseTablesUI(ServerObject serverObject, IEnumerable <string> tableNames)
        {
            var tablesNode = (TreeViewItem)serverObject.Control;

            tablesNode.Items.Clear();

            foreach (var tableName in tableNames)
            {
                tablesNode.Items.Add(GetTreeViewItem(tableName, "Images/table_sql.png", ServerObjectType.Table));
            }
        }
        /// <summary>
        /// Called from the view noting a user selecting a ;node.
        /// </summary>
        /// <param name="serverObject">The server object that the user selected.</param>
        public void SetServerObject(ServerObject serverObject)
        {
            _currentServerObject = serverObject;

            switch (_currentServerObject.Type)
            {
            case ServerObjectType.Server:
                SetCurrentServer();
                break;

            case ServerObjectType.Database:
                SetCurrentDatabase();
                break;

            case ServerObjectType.Table:
                SetCurrentTable();
                break;

            case ServerObjectType.View:
                SetCurrentView();
                break;
            }
        }