private void ProcessSaveButton() { Treeview.SelectedNode = Treeview.Nodes[0]; if (Treeview.SelectedNode != null && Treeview.SelectedNode.Parent == null) { Treeview.PathSeparator = "."; // Get the count of the child tree nodes contained in the SelectedNode. var myNodeCount = Treeview.SelectedNode.GetNodeCount(true); // MessageBox.Show(myNodeCount.ToString()); _ = (decimal)myNodeCount / (decimal)Treeview.GetNodeCount(true) * 100; if (myNodeCount > 0) { connectapi.Deleteassy(releaseLogNumber); if (Itemstodiscard.Count > 0) { Performdiscarditem(); } CheckItems(); if (itemcleartosave) { AddItems(); } } else { connectapi.Deleteassy(releaseLogNumber); if (Itemstodiscard.Count > 0) { Performdiscarditem(); } Lockdownsave(); // MessageBox.Show("Assembly list cannot be empty in order to save to AutoCad Catalog.", "SPM Connect", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } Itemstodiscard.Clear(); }