Пример #1
0
        public static void Fix(string package, string modelname, FixVersion ver)
        {
            if (System.IO.File.Exists(package))
            {
                SimPe.Packages.GeneratableFile pkg = SimPe.Packages.GeneratableFile.LoadFromFile(package);

                System.Collections.Hashtable map = RenameForm.GetNames((modelname.Trim() != ""), pkg, null, modelname);
                FixObject fo = new FixObject(pkg, ver, false);
                fo.Fix(map, false);
                fo.CleanUp();
                fo.FixGroup();

                pkg.Save();
            }
        }
Пример #2
0
        public Interfaces.Plugin.IToolResult ShowDialog(ref SimPe.Interfaces.Files.IPackedFileDescriptor pfd, ref SimPe.Interfaces.Files.IPackageFile package)
        {
            FixObject fo = new FixObject(package, FixVersion.UniversityReady, false);

            try
            {
                System.Collections.Hashtable map = fo.GetNameMap(false);
                if (map == null)
                {
                    return(new ToolResult(false, false));
                }

                WaitingScreen.Wait();

                fo.Fix(map, false);
                fo.CleanUp();
                fo.FixGroup();
            }
            catch (Exception ex)
            {
                Helper.ExceptionMessage("", ex);
            }
            finally
            {
                WaitingScreen.Stop();
            }

            if (Helper.StartedGui != Executable.Classic)
            {
                return(new ToolResult(false, false));
            }
            else
            {
                return(new ToolResult(false, true));
            }
        }