Ejemplo n.º 1
0
        /// <summary>
        ///     Loads the fs15 group mods.
        /// </summary>
        /// <param name="grp">The GRP.</param>
        /// <returns></returns>
        public IEnumerable <string> LoadFs15GroupMods(string grp)
        {
            var fs15 = new Fs15RegWork(true);
            var lst  = GetFilesFolders.GetFiles(fs15.Read(Fs15RegKeys.FS15_GROUPS) + grp + "\\", "*.zip");

            return(lst);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Loads the Fs15 profiles.
        /// </summary>
        /// <returns></returns>
        public IEnumerable <string> LoadFs15Profiles()
        {
            var fs15 = new Fs15RegWork(true);
            var lst  = GetFilesFolders.GetFolders(fs15.Read(Fs15RegKeys.FS15_PROFILES), "*.*");

            return(lst);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Loads the Fs15 mod choice.
        /// </summary>
        /// <param name="chc">The CHC.</param>
        /// <returns></returns>
        public string LoadFs15ModChoice(string chc)
        {
            var ets = new Fs15RegWork(true);
            var fnd = string.Empty;
            var dic = Serializer.DeserializeDictionary(ets.Read(Fs15RegKeys.FS15_XML) + "sortedFileListComplete.xml");

            if (dic.Any(v => string.Equals(v.Key, chc, StringComparison.OrdinalIgnoreCase)))
            {
                dic.TryGetValue(chc, out fnd);
            }
            return(fnd + chc);
        }
Ejemplo n.º 4
0
        private void bLoadGameFiles_Click(object sender, EventArgs e)
        {
            var    reg = new Fs15RegWork(true);
            var    gam = reg.Read(RegKeys.CURRENT_GAME);
            string pth;

            switch (gam)
            {
            case "FS15":
                pth = reg.Read(Fs15RegKeys.FS15_DATA_DIR);
                if (pth.IsNullOrEmpty())
                {
                    tree.Nodes.Clear();
                    var ofd = new FolderBrowserDialog {
                        Description = @"Navigate to your Game Data Folder"
                    };
                    ofd.ShowDialog();
                    if (!ofd.SelectedPath.FolderExists())
                    {
                        return;
                    }
                    reg.Write(Fs15RegKeys.FS15_DATA_DIR, ofd.SelectedPath + "\\vehicles\\");
                    LoadTree(ofd.SelectedPath);
                    return;
                }

                tree.Nodes.Clear();
                LoadTree(pth);
                break;

            case "FS17":
                pth = reg.Read(Fs17RegKeys.FS17_DATA_DIR);
                if (pth.IsNullOrEmpty())
                {
                    tree.Nodes.Clear();
                    var ofd = new FolderBrowserDialog {
                        Description = @"Navigate to your Game Data Folder"
                    };
                    ofd.ShowDialog();
                    if (!ofd.SelectedPath.FolderExists())
                    {
                        return;
                    }
                    reg.Write(Fs17RegKeys.FS17_DATA_DIR, ofd.SelectedPath + "\\vehicles\\");
                    LoadTree(reg.Read(Fs17RegKeys.FS17_DATA_DIR));
                    return;
                }

                tree.Nodes.Clear();
                LoadTree(pth);
                break;
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     Loads the Fs15 profile mods.
        /// </summary>
        /// <param name="prof">The PTH.</param>
        /// <returns></returns>
        public Dictionary <string, string> LoadFs15ProfileMods(string prof)
        {
            var fs15 = new Fs15RegWork(true);
            var pro  = fs15.Read(Fs15RegKeys.FS15_PROFILES) + prof + "\\" + prof + ".xml";

            if (!pro.FileExists())
            {
                return(null);
            }
            var dic = Serializer.DeserializeDictionary(pro);

            return(dic);
        }
Ejemplo n.º 6
0
        private static string GetLocation()
        {
            var gi  = new GameInfo();
            var tmp = gi.GetGame();

            if (tmp.IsNullOrEmpty())
            {
                return(null);
            }


            var pth = string.Empty;

            switch (tmp)
            {
            case "ATS":
                var atsp = new AtsRegWork(true);
                pth = atsp.Read(AtsRegKeys.ATS_GROUPS);
                break;

            case "ETS":
                var etsp = new EtsRegWork(true);
                pth = etsp.Read(EtsRegKeys.ETS_GROUPS);
                break;

            case "FS15":
                var fs15 = new Fs15RegWork(true);
                pth = fs15.Read(Fs15RegKeys.FS15_GROUPS);
                break;

            case "FS17":
                var fs17 = new Fs17RegWork(true);
                pth = fs17.Read(Fs17RegKeys.FS17_GROUPS);
                break;
            }

            var lst = GetFilesFolders.GetFolders(pth, "*.*");
            var frm = new ModMover();

            foreach (var f in lst)
            {
                frm.lstModMove.Items.Add(f);
            }

            frm.ShowDialog();

            var fld = frm.lstModMove.SelectedItem.ToString();

            frm.Close();
            return(fld);
        }
Ejemplo n.º 7
0
        private static void CreateFolders()
        {
            var atsw = new Fs15RegWork(true);

            var ofd = new FolderBrowserDialog {
                Description         = @"Navigate to where you want the top folder for FS15",
                ShowNewFolderButton = false
            };

            ofd.ShowDialog();
            if (!ofd.SelectedPath.FolderExists())
            {
                return;
            }
            var pth = ofd.SelectedPath;

            FolderCreator.CreatePublicFolders(pth + "\\FS15Repo");
            atsw.Write(Fs15RegKeys.FS15_REPO, pth + "\\FS15Repo\\");
            var tmp = pth + "\\FS15Repo\\";

            FolderCreator.CreatePublicFolders(tmp + "FS15Extraction");
            atsw.Write(Fs15RegKeys.FS15_EXTRACTION, tmp + "FS15Extraction");
            FolderCreator.CreatePublicFolders(tmp + "FS15Profiles");
            atsw.Write(Fs15RegKeys.FS15_PROFILES, tmp + "Fs15Profiles\\");
            FolderCreator.CreatePublicFolders(tmp + "FS15Groups");
            atsw.Write(Fs15RegKeys.FS15_GROUPS, tmp + "FS15Groups\\");
            FolderCreator.CreatePublicFolders(tmp + "FS15Xml");
            atsw.Write(Fs15RegKeys.FS15_XML, tmp + "FS15Xml\\");
            FolderCreator.CreatePublicFolders(tmp + "FS15Work");
            atsw.Write(Fs15RegKeys.FS15_WORK, tmp + "FS15Work\\");

            ofd = new FolderBrowserDialog {
                Description         = @"Navigate to Farming Simulator 2015 Mod Folder",
                ShowNewFolderButton = false
            };
            ofd.ShowDialog();
            if (ofd.SelectedPath.FolderExists())
            {
                atsw.Write(Fs15RegKeys.FS15_GAME_MOD_FOLDER, ofd.SelectedPath + "\\");
                var t   = ofd.SelectedPath.LastIndexOf("\\", StringComparison.OrdinalIgnoreCase);
                var fix = ofd.SelectedPath.Substring(0, t) + "\\";
                atsw.Write(Fs15RegKeys.FS15_GAME_SETTINGS_XML, fix + "gameSettings.xml");
            }

            MsgBx.Msg("All folders have been created for FS15", "Game Intializer");
        }
Ejemplo n.º 8
0
        /// <summary>
        ///     Starts the FS15.
        /// </summary>
        public void StartFs15()
        {
            var fs15 = new Fs15RegWork(true);
            var gam  = fs15.Read(Fs15RegKeys.FS15_START_GAME_PATH);

            if (gam.IsNullOrEmpty())
            {
                var ofd = new OpenFileDialog {
                    CheckFileExists = true,
                    Title           = @"Navigate to the Farming Simulator 2015 Exe"
                };

                ofd.ShowDialog();
                gam = ofd.FileName;
                fs15.Write(Fs15RegKeys.FS15_START_GAME_PATH, ofd.FileName);
            }

            Process.Start(gam);
        }
Ejemplo n.º 9
0
        /// <summary>
        ///     Initializes the Fs15.
        /// </summary>
        public void InitializeFs15()
        {
            var fs  = new Fs15RegWork(true);
            var tmp = fs.Read(Fs15RegKeys.FS15_REPO);

            if (!tmp.IsNullOrEmpty())
            {
                return;
            }

            var diag = MessageBox.Show(@"Do you want me to setup Farming Simulator 2015?", @"FS 15 Init",
                                       MessageBoxButtons.YesNo);

            if (diag != DialogResult.Yes)
            {
                return;
            }

            CreateFolders();
        }
Ejemplo n.º 10
0
        /// <summary>
        ///     Adds the new profile.
        /// </summary>
        /// <param name="nam">The nam.</param>
        public void AddNewProfile(string nam)
        {
            var gi  = new GameInfo();
            var gam = gi.GetGame();

            if (gam.IsNullOrEmpty())
            {
                return;
            }
            var pth = string.Empty;

            switch (gam)
            {
            case "ATS":
                var atsp = new AtsRegWork(true);
                pth = atsp.Read(AtsRegKeys.ATS_PROFILES) + nam;
                break;

            case "ETS":
                var etsp = new EtsRegWork(true);
                pth = etsp.Read(EtsRegKeys.ETS_PROFILES) + nam;
                break;

            case "FS15":
                var fs15 = new Fs15RegWork(true);
                pth = fs15.Read(Fs15RegKeys.FS15_PROFILES) + nam;
                break;

            case "FS17":
                var fs17 = new Fs17RegWork(true);
                pth = fs17.Read(Fs17RegKeys.FS17_PROFILES) + nam;
                break;
            }

            FolderCreator.CreatePublicFolders(pth);
        }
Ejemplo n.º 11
0
        /// <summary>
        ///     Creates the sorted lists.
        /// </summary>
        public void CreateSortedLists()
        {
            var gi  = new GameInfo();
            var tmp = gi.GetGame();

            if (tmp.IsNullOrEmpty())
            {
                return;
            }
            var src = string.Empty;

            var pth   = string.Empty;
            var cProf = string.Empty;

            switch (tmp)
            {
            case "ATS":
                var atsp = new AtsRegWork(true);
                pth = atsp.Read(AtsRegKeys.ATS_GROUPS);
                src = "*.scs";
                break;

            case "ETS":
                var etsp = new EtsRegWork(true);
                pth = etsp.Read(EtsRegKeys.ETS_GROUPS);
                src = "*.scs";
                break;

            case "FS15":
                var fs15 = new Fs15RegWork(true);
                pth = fs15.Read(Fs15RegKeys.FS15_GROUPS);
                src = "*.zip";
                break;

            case "FS17":
                var fs17 = new Fs17RegWork(true);
                pth   = fs17.Read(Fs17RegKeys.FS17_GROUPS);
                cProf = fs17.Read(Fs17RegKeys.FS17_PROFILES);
                src   = "*.zip";
                break;
            }

            var foldList = GetFilesFolders.GetFolders(pth, "*.*");
            var profList = GetFilesFolders.GetFolders(cProf, "*.*");

            foreach (var v in foldList)
            {
                var lst = GetFilesFolders.GetFiles(v, src);
                var dic = new Dictionary <string, string>();
                foreach (var t in lst)
                {
                    if (CheckPath(t))
                    {
                        continue;
                    }
                    var file = t.GetFileName();
                    var ph   = Path.GetDirectoryName(t);
                    if (dic.ContainsKey(file))
                    {
                        continue;
                    }
                    dic.Add(file, ph + "\\");
                }

                var nam = v.GetLastFolderName();
                Serializer.SerializeDictionary(v + "\\" + nam + ".xml", dic);
            }

            foreach (var v in profList)
            {
                var lst = GetFilesFolders.GetFiles(v, src);
                var dic = new Dictionary <string, string>();
                foreach (var t in lst)
                {
                    if (CheckPath(t))
                    {
                        continue;
                    }
                    var file = t.GetFileName();
                    var ph   = Path.GetDirectoryName(t);
                    if (dic.ContainsKey(file))
                    {
                        continue;
                    }
                    dic.Add(file, ph + "\\");
                }

                var nam = v.GetLastFolderName();
                Serializer.SerializeDictionary(v + "\\" + nam + ".xml", dic);
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        ///     Makes the sorted list.
        /// </summary>
        public void SortedFileListComplete()
        {
            var dic = new Dictionary <string, string>();
            var gi  = new GameInfo();
            var tmp = gi.GetGame();

            if (tmp.IsNullOrEmpty())
            {
                return;
            }
            IEnumerable <string> lst = null;
            var path = string.Empty;

            switch (tmp)
            {
            case "ATS":
                var atsP = new AtsRegWork(true);
                path       = atsP.Read(AtsRegKeys.ATS_XML) + "sortedFileListComplete.xml";
                FolderPath = atsP.Read(AtsRegKeys.ATS_GROUPS);
                lst        = GetFilesFolders.GetFilesRecursive(FolderPath, "*.scs");
                break;

            case "ETS":
                var etsP = new EtsRegWork(true);
                path       = etsP.Read(EtsRegKeys.ETS_XML) + "sortedFileListComplete.xml";
                FolderPath = etsP.Read(EtsRegKeys.ETS_GROUPS);
                lst        = GetFilesFolders.GetFilesRecursive(FolderPath, "*.scs");
                break;

            case "FS15":
                var fs15 = new Fs15RegWork(true);
                path       = fs15.Read(Fs15RegKeys.FS15_XML) + "sortedFileListComplete.xml";
                FolderPath = fs15.Read(Fs15RegKeys.FS15_GROUPS);
                lst        = GetFilesFolders.GetFilesRecursive(FolderPath, "*.zip");
                break;

            case "FS17":
                var fs17 = new Fs17RegWork(true);
                path       = fs17.Read(Fs17RegKeys.FS17_XML) + "sortedFileListComplete.xml";
                FolderPath = fs17.Read(Fs17RegKeys.FS17_GROUPS);
                lst        = GetFilesFolders.GetFilesRecursive(FolderPath, "*.zip");
                break;
            }

            if (lst.IsNull())
            {
                return;
            }
            Debug.Assert(lst != null, nameof(lst) + " != null");
            foreach (var v in lst)
            {
                var file = v.GetFileName();
                var pth  = Path.GetDirectoryName(v);
                if (dic.ContainsKey(file))
                {
                    continue;
                }
                dic.Add(file, pth + "\\");
            }

            Serializer.SerializeDictionary(path, dic);
            MsgBx.Msg("List Creation Completed", "List Creator");
        }
Ejemplo n.º 13
0
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            var reg   = new AtsRegWork(true);
            var gam   = reg.Read(RegKeys.CURRENT_GAME);
            var cProf = reg.Read(RegKeys.CURRENT_PROFILE);

            if (gam.IsNullOrEmpty() || cProf.IsNullOrEmpty())
            {
                MsgBx.Msg("You need to have a Profile / Game active", "Process Error");
                return;
            }

            string tmp;
            string profPath;
            Dictionary <string, string> lst = null;

            lstProfileMods.Items.Clear();

            switch (gam)
            {
            case "ATS":
                var ats  = new AtsLoader();
                var atsp = new AtsRegWork(true);
                var prof = new ProfileWorker();
                tmp      = ats.LoadAtsModChoice(lstAvailableMods.SelectedItem.ToString());
                profPath = atsp.Read(AtsRegKeys.ATS_GAME_MOD_FOLDER) + tmp.GetFileName();
                prof.BuildProfileList(lstAvailableMods.SelectedItem.ToString());
                SymLinks.CreateSymLink(profPath, tmp, 0);
                lst = ats.LoadAtsProfileMods(reg.Read(RegKeys.CURRENT_PROFILE));
                break;

            case "ETS":
                var ets  = new EtsLoader();
                var etsp = new EtsRegWork(true);
                prof     = new ProfileWorker();
                tmp      = ets.LoadEtsModChoice(lstAvailableMods.SelectedItem.ToString());
                profPath = etsp.Read(EtsRegKeys.ETS_GAME_MOD_FOLDER) + tmp.GetFileName();
                prof.BuildProfileList(lstAvailableMods.SelectedItem.ToString());
                SymLinks.CreateSymLink(profPath, tmp, 0);
                lst = ets.LoadEtsProfileMods(reg.Read(RegKeys.CURRENT_PROFILE));
                break;

            case "FS15":
                var fs15  = new Fs15Loader();
                var fs15P = new Fs15RegWork(true);
                tmp      = fs15.LoadFs15ModChoice(lstAvailableMods.SelectedItem.ToString());
                profPath = fs15P.Read(Fs15RegKeys.FS15_PROFILES) + reg.Read(RegKeys.CURRENT_PROFILE) + "\\" +
                           tmp.GetFileName();
                prof = new ProfileWorker();
                prof.BuildProfileList(lstAvailableMods.SelectedItem.ToString());
                SymLinks.CreateSymLink(profPath, tmp, 0);
                lst = fs15.LoadFs15ProfileMods(reg.Read(RegKeys.CURRENT_PROFILE));
                break;

            case "FS17":
                var fs17  = new Fs17Loader();
                var fs17P = new Fs17RegWork(true);
                tmp      = fs17.LoadFs17ModChoice(lstAvailableMods.SelectedItem.ToString());
                profPath = fs17P.Read(Fs17RegKeys.FS17_PROFILES) + reg.Read(RegKeys.CURRENT_PROFILE) + "\\" +
                           tmp.GetFileName();
                prof = new ProfileWorker();
                prof.BuildProfileList(lstAvailableMods.SelectedItem.ToString());
                SymLinks.CreateSymLink(profPath, tmp, 0);
                lst = fs17.LoadFs17ProfileMods(reg.Read(RegKeys.CURRENT_PROFILE));
                break;
            }

            if (lst == null)
            {
                return;
            }
            foreach (var v in lst)
            {
                lstProfileMods.Items.Add(v.Key);
            }

            CheckModCount();
            label2.Text = @"Active Mods: " + lstProfileMods.Items.Count;

            // MsgBx.Msg("Profile Link Created", "Linker");
        }
Ejemplo n.º 14
0
        public void OrganizeMaps()
        {
            var mapLst = new List <string> {
                "map",
                "Map"
            };

            var reg = new AtsRegWork(true);
            var gam = reg.Read(RegKeys.CURRENT_GAME);

            if (gam.IsNullOrEmpty())
            {
                MsgBx.Msg("Mod Sorting is Game specific, you need to choose a game", "Game Error");
                return;
            }

            SetSearchLists();

            string tmp;
            IEnumerable <string> lst;

            switch (gam)
            {
            case "ATS":
                tmp = reg.Read(AtsRegKeys.ATS_REPO);
                lst = GetFilesFolders.GetFiles(tmp, "*.scs");
                if (lst.IsNull())
                {
                    return;
                }
                foreach (var v in lst)
                {
                    foreach (var t in _srchLstTs)
                    {
                        if (!v.Contains(t, StringComparison.OrdinalIgnoreCase))
                        {
                            continue;
                        }
                        FolderCreator.CreatePublicFolders(reg.Read(AtsRegKeys.ATS_GROUPS) + t);
                        FileCopyMove.FileCopy(v, reg.Read(AtsRegKeys.ATS_GROUPS) + t + "\\" + v.GetFileName(),
                                              true);
                    }
                }

                break;

            case "ETS":
                var ets = new EtsRegWork(true);
                tmp = ets.Read(EtsRegKeys.ETS_REPO);
                lst = GetFilesFolders.GetFiles(tmp, "*.scs");
                if (lst.IsNull())
                {
                    return;
                }
                foreach (var v in lst)
                {
                    foreach (var t in _srchLstTs)
                    {
                        if (!v.Contains(t, StringComparison.OrdinalIgnoreCase))
                        {
                            continue;
                        }
                        FolderCreator.CreatePublicFolders(ets.Read(EtsRegKeys.ETS_GROUPS) + t);
                        FileCopyMove.FileCopy(v, ets.Read(EtsRegKeys.ETS_GROUPS) + t + "\\" + v.GetFileName(),
                                              true);
                    }
                }

                break;

            case "FS15":
                var fs15 = new Fs15RegWork(true);
                tmp = fs15.Read(Fs15RegKeys.FS15_REPO);
                lst = GetFilesFolders.GetFiles(tmp, "*.zip");
                if (lst.IsNull())
                {
                    return;
                }
                foreach (var v in lst)
                {
                    foreach (var t in _srchLstFs)
                    {
                        if (!v.Contains(t, StringComparison.OrdinalIgnoreCase))
                        {
                            continue;
                        }
                        FolderCreator.CreatePublicFolders(fs15.Read(Fs15RegKeys.FS15_GROUPS) + t);
                        FileCopyMove.FileCopy(v, fs15.Read(Fs15RegKeys.FS15_GROUPS) + t + "\\" + v.GetFileName(),
                                              true);
                    }
                }

                break;

            case "FS17":
                var fs17      = new Fs17RegWork(true);
                var bypass    = new SortingBypass();
                var byPassDat = bypass.GetBypassList();
                tmp = fs17.Read(Fs17RegKeys.FS17_GROUPS);
                var fldLst  = GetFilesFolders.GetFolders(tmp, "*.*");
                var chkList = new List <string>();
                var enu     = fldLst.ToList();
                foreach (var v in enu)
                {
                    var chk = v.GetLastFolderName();
                    if (byPassDat.ContainsKey(chk))
                    {
                        continue;
                    }
                    chkList.Add(v);
                }

                if (chkList.IsNull())
                {
                    return;
                }
                foreach (var v in chkList)
                {
                    lst = GetFilesFolders.GetFiles(v + "\\", "*.zip");
                    foreach (var f in lst)
                    {
                        foreach (var t in mapLst)
                        {
                            if (!f.Contains(t, StringComparison.OrdinalIgnoreCase))
                            {
                                continue;
                            }
                            var src = tmp + "\\" + "Map" + "\\" + f.GetFileName();
                            if (src.FileExists())
                            {
                                continue;
                            }
                            FileCopyMove.FileCopy(f, src, true);
                        }
                    }
                }

                break;
            }

            var lstCreate = new ListCreator();

            lstCreate.CreateSortedLists();
            lstCreate.SortedFileListComplete();
            MsgBx.Msg("Map Sorting Complete", "Map Sorter");
        }
Ejemplo n.º 15
0
        /// <summary>
        ///     Sorts the mods.
        /// </summary>
        public void SortMods()
        {
            SetSearchLists();

            var reg = new AtsRegWork(true);
            var gam = reg.Read(RegKeys.CURRENT_GAME);

            if (gam.IsNullOrEmpty())
            {
                MsgBx.Msg("Mod Sorting is Game specific, you need to choose a game", "Game Error");
                return;
            }

            string tmp;
            IEnumerable <string> lst;

            switch (gam)
            {
            case "ATS":
                tmp = reg.Read(AtsRegKeys.ATS_REPO);
                lst = GetFilesFolders.GetFiles(tmp, "*.scs");
                if (lst.IsNull())
                {
                    return;
                }
                foreach (var v in lst)
                {
                    foreach (var t in _srchLstTs)
                    {
                        if (!v.Contains(t, StringComparison.OrdinalIgnoreCase))
                        {
                            continue;
                        }
                        FolderCreator.CreatePublicFolders(reg.Read(AtsRegKeys.ATS_GROUPS) + t);
                        FileCopyMove.FileCopy(v, reg.Read(AtsRegKeys.ATS_GROUPS) + t + "\\" + v.GetFileName(),
                                              true);
                    }
                }

                break;

            case "ETS":
                var ets = new EtsRegWork(true);
                tmp = ets.Read(EtsRegKeys.ETS_REPO);
                lst = GetFilesFolders.GetFiles(tmp, "*.scs");
                if (lst.IsNull())
                {
                    return;
                }
                foreach (var v in lst)
                {
                    foreach (var t in _srchLstTs)
                    {
                        if (!v.Contains(t, StringComparison.OrdinalIgnoreCase))
                        {
                            continue;
                        }
                        FolderCreator.CreatePublicFolders(ets.Read(EtsRegKeys.ETS_GROUPS) + t);
                        FileCopyMove.FileCopy(v, ets.Read(EtsRegKeys.ETS_GROUPS) + t + "\\" + v.GetFileName(),
                                              true);
                    }
                }

                break;

            case "FS15":
                var fs15 = new Fs15RegWork(true);
                tmp = fs15.Read(Fs15RegKeys.FS15_REPO);
                lst = GetFilesFolders.GetFiles(tmp, "*.zip");
                if (lst.IsNull())
                {
                    return;
                }
                foreach (var v in lst)
                {
                    foreach (var t in _srchLstFs)
                    {
                        if (!v.Contains(t, StringComparison.OrdinalIgnoreCase))
                        {
                            continue;
                        }
                        FolderCreator.CreatePublicFolders(fs15.Read(Fs15RegKeys.FS15_GROUPS) + t);
                        FileCopyMove.FileCopy(v, fs15.Read(Fs15RegKeys.FS15_GROUPS) + t + "\\" + v.GetFileName(),
                                              true);
                    }
                }

                break;

            case "FS17":
                var fs17 = new Fs17RegWork(true);
                tmp = fs17.Read(Fs17RegKeys.FS17_REPO);
                lst = GetFilesFolders.GetFiles(tmp, "*.zip");
                if (lst.IsNull())
                {
                    return;
                }
                foreach (var v in lst)
                {
                    foreach (var t in _srchLstFs)
                    {
                        if (!v.Contains(t, StringComparison.OrdinalIgnoreCase))
                        {
                            continue;
                        }
                        FolderCreator.CreatePublicFolders(fs17.Read(Fs17RegKeys.FS17_GROUPS) + t);
                        FileCopyMove.FileCopy(v, fs17.Read(Fs17RegKeys.FS17_GROUPS) + t + "\\" + v.GetFileName(),
                                              true);
                    }
                }

                break;
            }

            DoCleanUp();
        }
Ejemplo n.º 16
0
        private static void DoCleanUp()
        {
            var    reg = new AtsRegWork(true);
            var    gam = reg.Read(RegKeys.CURRENT_GAME);
            string tmp;
            IEnumerable <string> lst;

            switch (gam)
            {
            case "ATS":
                tmp = reg.Read(AtsRegKeys.ATS_REPO);
                lst = GetFilesFolders.GetFiles(tmp, "*.scs");
                FolderCreator.CreatePublicFolders(reg.Read(AtsRegKeys.ATS_GROUPS) + "misc");
                foreach (var v in lst)
                {
                    FileCopyMove.FileCopy(v, reg.Read(AtsRegKeys.ATS_GROUPS) + "misc" + "\\" + v.GetFileName(),
                                          true);
                }

                break;

            case "ETS":
                var ets = new EtsRegWork(true);
                tmp = ets.Read(EtsRegKeys.ETS_REPO);
                lst = GetFilesFolders.GetFiles(tmp, "*.scs");
                FolderCreator.CreatePublicFolders(ets.Read(EtsRegKeys.ETS_GROUPS) + "misc");
                foreach (var t in lst)
                {
                    FileCopyMove.FileCopy(t, ets.Read(EtsRegKeys.ETS_GROUPS) + "misc" + "\\" + t.GetFileName(),
                                          true);
                }

                break;

            case "FS15":
                var fs15 = new Fs15RegWork(true);
                tmp = fs15.Read(Fs15RegKeys.FS15_REPO);
                lst = GetFilesFolders.GetFiles(tmp, "*.zip");
                FolderCreator.CreatePublicFolders(fs15.Read(Fs15RegKeys.FS15_GROUPS) + "misc");
                foreach (var v in lst)
                {
                    FileCopyMove.FileCopy(v, fs15.Read(Fs15RegKeys.FS15_GROUPS) + "misc" + "\\" + v.GetFileName(),
                                          true);
                }

                break;

            case "FS17":
                var fs17 = new Fs17RegWork(true);
                tmp = fs17.Read(Fs17RegKeys.FS17_REPO);
                lst = GetFilesFolders.GetFiles(tmp, "*.zip");
                FolderCreator.CreatePublicFolders(fs17.Read(Fs17RegKeys.FS17_GROUPS) + "misc");
                foreach (var v in lst)
                {
                    FileCopyMove.FileCopy(v, fs17.Read(Fs17RegKeys.FS17_GROUPS) + "misc" + "\\" + v.GetFileName(),
                                          true);
                }

                break;
            }

            var lstCreate = new ListCreator();

            lstCreate.CreateSortedLists();
            lstCreate.SortedFileListComplete();
            MsgBx.Msg("Mod Sorting Complete", "Mod Sorter");
        }