Exemplo n.º 1
0
        public FomodFile(XmlNode node)
        {
            IsFolder = node.Name.Equals("folder");
            Source   = node.Attributes["source"].Value.Replace('\t', ' ').Replace('/', '\\');
            if (IsFolder)
            {
                Source = PathExtensions.AppendDelimiter(Source);
            }
            if (node.Attributes["destination"] != null)
            {
                Destination = node.Attributes["destination"].Value.Replace('\t', ' ').Replace('/', '\\');
                if (IsFolder && !string.IsNullOrEmpty(Destination))
                {
                    Destination = PathExtensions.AppendDelimiter(Destination);
                }
            }
            else
            {
                Destination = "";
            }
            if (node.Attributes["priority"] != null)
            {
                Priority = Int32.Parse(node.Attributes["priority"].Value);
            }

            Expr = new Regex("^" + Regex.Escape(Source), RegexOptions.IgnoreCase);
        }
Exemplo n.º 2
0
 public static void SaveIniSettings()
 {
     try {
         if (!File.Exists("settings.ini"))
         {
             LogService.GroupMessage("settings", "Initializing ModDump setting.ini");
             ModDump.InitSettings();
         }
         FileIniDataParser parser = new FileIniDataParser();
         IniData           data   = parser.ReadFile("settings.ini");
         data.Sections["Games"]["skyrimPath"]   = PathExtensions.AppendDelimiter(Settings.SkyrimPath);
         data.Sections["Games"]["skyrimSEPath"] = PathExtensions.AppendDelimiter(Settings.SkyrimSEPath);
         parser.WriteFile("settings.ini", data);
     } catch (Exception x) {
         LogService.GroupMessage("settings", "Error settings ModDump settings: " + x.Message);
     }
 }