コード例 #1
0
        /// <summary>
        /// Load the profile from the user directory
        /// </summary>
        /// <param name="UserAppDir"></param>
        public static void Init(string UserAppDir)
        {
            string profilePath = UserAppDir + "\\SokoSolveProfile.xml";

            if (File.Exists(profilePath))
            {
                current = new Profile();
                current.Load(profilePath);
            }
            else
            {
                current = new Profile();
                current.UserName = "******";
                current.UserEmail = "*****@*****.**";
                current.UserHomepage = "http://sokosolve.sourceforge.net";
                current.UserLicense = "Creative Commons";

                string initLib = FileManager.GetContent("$Libraries", "Sasquatch.ssx");
                if (File.Exists(initLib))
                {
                    // Set defaults
                    current.LibraryCurrentOpenDir = FileManager.GetContent("$Libraries");
                    current.LibraryLastFile = initLib;
                    current.LibraryLastPuzzle = "";
                    current.LibraryCurrentImportDir = FileManager.GetContent("$Libraries");

                    SokoSolveProfileLibrary lib = new SokoSolveProfileLibrary();
                    lib.LibraryID = "L1";
                    lib.FileName = current.LibraryLastFile;
                    lib.Name = "Sasquatch";
                    lib.Order = 1;
                    current.Register(lib);
                }
            }
        }
コード例 #2
0
ファイル: Profile.cs プロジェクト: rfrfrf/SokoSolve-Sokoban
 public void Register(SokoSolveProfileLibrary newLib)
 {
     currentXML.LibraryRepository = ListHelper.AddToArray<SokoSolveProfileLibrary>(currentXML.LibraryRepository, newLib);
 }