Ejemplo n.º 1
0
 private void WriteFile(string filename, string content)
 {
     Printer.Info("Writing output to file: " + filename);
     File.WriteAllText(filename, content);
     if (options.CloudUpload)
         CloudUpload(filename);
 }
Ejemplo n.º 2
0
 private void DeleteDestination()
 {
     if (File.Exists(destination))
     {
         File.Delete(destination);
         Printer.Info(string.Format("Overwriting previous file: {0}", destination));
     }
 }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
 private void CloudUpload(string filename)
 {
     Printer.Info(string.Format("Uploading {0} to cloud.", Path.GetFileName(filename)));
     CloudStorage storage = new CloudStorage();
     storage.Upload(filename);
 }
Ejemplo n.º 6
0
 private void PrintSessionSummary(DeviceSession session, int index)
 {
     Printer.Info(string.Format("\t{0}: {1}", index + 1, session));
 }