示例#1
0
        public static void doSavePO_ToSpecifiedFolder(string absoluteFolderPath, object obj, string filename = "")
        {
            AXParametricObject po = (AXParametricObject)obj;

            if (string.IsNullOrEmpty(filename))
            {
                filename = po.Name + ".axobj";
            }

            string absoluteFilePath = System.IO.Path.Combine(absoluteFolderPath, filename);


            if (System.IO.Directory.Exists(absoluteFolderPath))
            {
                // file exists, ask to  overwrite or rename
                if (System.IO.File.Exists(absoluteFilePath))
                {
                    doSave_SaveFilePanel(absoluteFolderPath, filename, obj);
                }

                else
                {
                    LibraryEditor.saveParametricObject(po, true, absoluteFilePath);
                }
            }
            else
            {
                doSave_MenuItem_NewFolder(obj);
            }
        }