Esempio n. 1
0
        private bool CreateBatchFile(string path, string parameters)
        {
            try
            {
                if (!_fileHandler.CheckIfAppDirectoryExists(AppSettings.ApplicationDataPath))
                {
                    if (!_fileHandler.CreateAppDirectory(AppSettings.ApplicationDataPath))
                    {
                        return(false);
                    }
                }

                using (StreamWriter batchFileWriter = new StreamWriter(AppSettings.PathToSaveBatchFile))
                {
                    batchFileWriter.Write(AppSettings.BatchFileSkeleton, path, Environment.NewLine, parameters);
                    batchFileWriter.Close();
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }