private void RefreshFunction(ObjectExplorerNode selectedNode, int indexOfNodeToReplace)
 {
     if (selectedNode.Data is UserDefinedFunction function)
     {
         function.Refresh();
         _objectExplorerDataSource.DataSource[indexOfNodeToReplace] = ObjectExplorerNodeFactory.CreateFunctionNode(
             selectedNode.Id, selectedNode.ParentId,
             function);
     }
 }
        private void CreateFunctionNodes(ObjectExplorerNode model)
        {
            if (!(model.Data is Database database))
            {
                return;
            }
            if ((database.UserDefinedFunctions.Count <= 0))
            {
                CreateEmptyNode(model);
                return;
            }

            foreach (UserDefinedFunction function in database.UserDefinedFunctions)
            {
                DataSource.Add(ObjectExplorerNodeFactory.CreateFunctionNode(GetNewNodeId(), model.Id, function));
            }
        }