Пример #1
0
            /// <summary>
            /// Read Nuget NuSpec File to Populate nugetSpec Object
            /// </summary>
            /// <param name="NuSpecPath"></param>
            /// <returns></returns>
            public nugetSpec ReadNuSpec(string NuSpecPath)
            {
                nugetSpec sln    = new nugetSpec();
                _AHK      ahk    = new _AHK();
                _Parse    prs    = new _Parse();
                string    nutext = ahk.FileRead(NuSpecPath);

                if (nutext != "")
                {
                    sln.csproj               = prs.XML_Text(nutext, "<id>");
                    sln.authors              = prs.XML_Text(nutext, "<authors>");
                    sln.version              = prs.XML_Text(nutext, "<version>");
                    sln.owners               = prs.XML_Text(nutext, "<owners>");
                    sln.LicenseURL           = prs.XML_Text(nutext, "<licenseUrl>");
                    sln.projecturl           = prs.XML_Text(nutext, "<projectUrl>");
                    sln.iconurl              = prs.XML_Text(nutext, "<iconUrl>");
                    sln.requireLicAcceptance = prs.XML_Text(nutext, "<requireLicenseAcceptance>").ToBool();
                    sln.description          = prs.XML_Text(nutext, "<description>");
                    sln.releasenotes         = prs.XML_Text(nutext, "<releaseNotes>");
                    sln.copyright            = prs.XML_Text(nutext, "<copyright>");
                    sln.tags = prs.XML_Text(nutext, "<tags>");
                }

                return(sln);
            }
Пример #2
0
            public void RAR_EachFileInDir(RadProgressBar radProgress, string DirPath, bool NewThread = true, bool EpNumRARName = true, string Prefix = "")
            {
                _AHK ahk = new _AHK();

                if (NewThread)
                {
                    Thread imdbTVParseThread = new Thread(() => RAR_EachFileInDir(radProgress, DirPath, false, EpNumRARName, Prefix));
                    imdbTVParseThread.Start();
                }
                else
                {
                    _TelerikLib.RadProgress pro = new _TelerikLib.RadProgress();
                    _Lists lst = new _Lists();
                    _Parse prs = new _Parse();

                    string rar = @"C:\_Code\LucidProjects\ADBindex\ComPress\bin\Debug\Lib\rar.exe";

                    List <string> files = lst.FileList(DirPath);

                    pro.SetupProgressBar(radProgress, files.Count);

                    string RelativePath = "-ep";

                    string fileDir = ahk.FileDir(DirPath); int i = 0;
                    foreach (string file in files)
                    {
                        if (ahk.FileExt(file).ToUpper() == ".URL")
                        {
                            continue;
                        }


                        // extract season/ep number from file name
                        string epNum = prs.SeasonEpNums(file);

                        i++; pro.UpdateProgress(radProgress, ahk.FileName(file) + " " + i + "/" + files.Count);
                        string newRAR = fileDir + "\\" + Prefix + epNum + ".rar";

                        // use the file name as the zip file name
                        if (!EpNumRARName)
                        {
                            newRAR = fileDir + "\\" + ahk.FileNameNoExt(file) + ".rar";
                        }

                        if (File.Exists(newRAR))
                        {
                            continue;
                        }


                        string FIle = file.Replace(",", "`,");

                        string cmd = rar + " A -m0 " + RelativePath + " " + "\"" + newRAR + "\" \"" + FIle + "\"";
                        ahk.RunWait(cmd, "", "Hide");
                    }

                    ahk.MsgBox("Finished RARing " + files.Count + " Files");
                }
            }