internal void ReloadTemplate(string path, bool top_level)
        {
            if (top_level && !String.IsNullOrWhiteSpace(template))
            {
                if (File.Exists(template))
                {
                    return;
                }
                template = "";
            }
            string full_path = null;

            try
            {
                full_path = System.IO.Path.GetFullPath(path);
            }
            catch
            {
                full_path = null;
            }
            if (full_path != null)
            {
                if (!top_level)
                {
                    if (File.Exists(full_path) && String.IsNullOrWhiteSpace(template))
                    {
                        template = path;
                    }
                }
                setup_attach_components = FindAllAttachComponents(full_path);
                setup_attach_components.Sort();
                setup_subsystems = VericutMachineReader.GetMachineSubsystems(full_path);
                setup_subsystems.Sort();
            }
        }
        internal string VerifySetupInfo(string prefix, bool is_error)
        {
            string warning_message = "";

            // Verify setup template and load components and subsystems.
            bool verify_components = true;

            if (!VerifyFile(ref template, ref warning_message, prefix))
            {
                warning_message  += prefix + String.Format(Properties.Resources.IDS_NoTemplateVerification) + "\n";
                verify_components = false;
                template          = "";
            }
            if (String.IsNullOrWhiteSpace(template))
            {
                verify_components = false;
            }
            if (verify_components)
            {
                setup_attach_components = FindAllAttachComponents(System.IO.Path.GetFullPath(template));
                setup_attach_components.Sort();
                setup_subsystems = VericutMachineReader.GetMachineSubsystems(System.IO.Path.GetFullPath(template));
                setup_subsystems.Sort();
            }

            pmtoolpaths  = PowerMILLAutomation.GetListOf(PowerMILLAutomation.enumEntity.Toolpaths);
            nc_programs  = PowerMILLAutomation.GetListOf(PowerMILLAutomation.enumEntity.NCPrograms);
            models       = PowerMILLAutomation.GetListOf(PowerMILLAutomation.enumEntity.Models);
            stock_models = PowerMILLAutomation.GetListOf(PowerMILLAutomation.enumEntity.StockModels);

            VerifyWorkplane(ref attach_workplane, ref warning_message, prefix);
            if (verify_components)
            {
                VerifyComponent(ref attach_workplane_to, ref warning_message, prefix);
            }

            if (verify_components)
            {
                VerifyComponent(ref block_attach_to, ref warning_message, prefix);
            }
            if (is_error)
            {
                VerifyFile(ref block_stl_fpath, ref warning_message, prefix);
            }

            VerifyStockModel(ref block_stockmodel, ref warning_message, prefix);
            if (is_error)
            {
                VerifyFile(ref block_toolpath, ref warning_message, prefix);
            }

            if (verify_components)
            {
                VerifyComponent(ref fixture_attach_to, ref warning_message, prefix);
            }

            VerifyModels(fixture_models, ref warning_message, prefix);
            if (is_error)
            {
                VerifyFiles(fixture_stl_fpaths, ref warning_message, prefix);
            }

            VerifyWorkplane(ref model_workplane, ref warning_message, prefix);

            VerifyNCPrograms(nc_progs, ref warning_message, prefix);
            VerifyWorkplane(ref nc_workplane, ref warning_message, prefix);

            if (verify_components)
            {
                VerifyWorkOffsets(offsets, ref warning_message, prefix);
            }

            if (verify_components)
            {
                VerifyComponent(ref part_attach_to, ref warning_message, prefix);
            }
            VerifyModels(part_models, ref warning_message, prefix);
            if (is_error)
            {
                VerifyFiles(part_stl_fpaths, ref warning_message, prefix);
                VerifyFile(ref tls_fpath, ref warning_message, prefix);
            }

            VerifyToolpaths(toolpaths, ref warning_message, prefix);
            VerifyWorkplanes(workplanes_to_export, ref warning_message, prefix);

            return(warning_message);
        }