private void WriteFile(string filename, string content)
 {
     Printer.Info("Writing output to file: " + filename);
     File.WriteAllText(filename, content);
     if (options.CloudUpload)
         CloudUpload(filename);
 }
Beispiel #2
0
 private void DeleteDestination()
 {
     if (File.Exists(destination))
     {
         File.Delete(destination);
         Printer.Info(string.Format("Overwriting previous file: {0}", destination));
     }
 }
 private void PrintSummary()
 {
     Printer.Info(string.Format("File contained {0} session(s).", sessions.Count));
     if (!string.IsNullOrEmpty(options.Query))
         Printer.Info("Query = " + options.Query);
     var enumerator = GetSelectedSessions();
     foreach (var session in enumerator)
         PrintSessionSummary(session, enumerator.Index);
 }
        private void WriteOutput(string content, int sessionIndex, int sessionCount)
        {
            if (content == string.Empty)
                throw new ApplicationException("Nothing to write for session: " + sessionIndex + 1);

            if (options.Output == OutputType.Console)
                Printer.Info(content);
            else if (options.Output == OutputType.File)
            {
                string filename = options.GetDestinationFilename(sessionIndex, sessionCount);
                WriteFile(filename, content);
            }
        }
 private void CloudUpload(string filename)
 {
     Printer.Info(string.Format("Uploading {0} to cloud.", Path.GetFileName(filename)));
     CloudStorage storage = new CloudStorage();
     storage.Upload(filename);
 }
 private void PrintSessionSummary(DeviceSession session, int index)
 {
     Printer.Info(string.Format("\t{0}: {1}", index + 1, session));
 }