Exemplo n.º 1
0
        public bool WriteLinks()
        {
            cFile oFile = new cFile(msExportedLinkPath);

            try
            {
                string sOutput = "" + msUrlList[0];

                //oFile.FileName = msExportedLinkPath;
                for (int i = 1; i < msUrlList.Count; i++)
                {
                    sOutput += Environment.NewLine + msUrlList[i];
                }
                oFile.Write(sOutput);

                Parallel.For(0, sFileList.Count, x =>
                {
                    oFile.FileName = sFileList[x];
                    oFile.Delete();
                });
                return(true);
            }
            catch (Exception ex)
            {
                oFile.WriteLog(ex.Message, "WriteLinksError.log");
                return(false);

                throw ex;
            }
        }
Exemplo n.º 2
0
        public bool Save()
        {
            // Delete the output file
            cFile oFile = new cFile();

            oFile.Delete();
            oFile = null;


            //foreach (cLinkCategory oLinkCategory in this)
            foreach (cLinkCategory oLinkCategory in oCatagories)
            {
                oLinkCategory.Save(msFileName);
            }

            return(true);
        }
Exemplo n.º 3
0
        public bool LoadToFile(string vsPath)
        {
            cFile oFile = new cFile(vsPath);

            try
            {
                List <String> sNewUrlList = oFile.ReadList();
                Parallel.For(0, sNewUrlList.Count, x =>
                {
                    string sUrl1 = sNewUrlList[x];
                    oFile.SaveLink(sUrl1, msExportedLinkPath);
                });
                oFile.Delete();

                return(true);
            }

            catch (Exception ex)
            {
                throw ex;
            }
            //throw new NotImplementedException();
        }