示例#1
0
        private static void setDefaultConfiguration()
        {
            var appSettingsModel = new AppSettingsModel
            {
                UserName = null,

                Step1DateSelectionType = 1,

                LastDateFromUsed = DateTime.UtcNow.AddDays(-1).Date,
                LastDateToUsed   = DateTime.UtcNow.Date,

                ProjectFolderPath = null,

                ProjectFilePaths = new List <ProjectFilePath>().ToArray(),

                Step5GroupByType = 1,

                Step6FileNamePattern = "E.T {UserName} - {ProjectName}.txt",
                PrettierFormat       = "email",

                TryToUpload     = false,
                DriveFolderName = null,

                SaveFilePath = null
            };

            var filePath = Path.Combine(Directory.GetCurrentDirectory(), "appSettings.json");
            var output   = Newtonsoft.Json.JsonConvert.SerializeObject(appSettingsModel, Newtonsoft.Json.Formatting.Indented);

            File.WriteAllText(filePath, output);
        }
示例#2
0
 public Main(GoogleDriveUploaderService googleDriveUploaderService, AppSettingsModel appSettingsModel, FileManagerService fileManagerService, GitService gitService)
 {
     _googleDriveUploaderService = googleDriveUploaderService;
     _fileManagerService         = fileManagerService;
     _gitService       = gitService;
     _appSettingsModel = appSettingsModel;
     InitializeComponent();
 }
        public GoogleDriveUploaderService(AppSettingsModel appSettingsModel)
        {
            _appSettingsModel = appSettingsModel;

            if (_appSettingsModel.installed != null && !string.IsNullOrEmpty(_appSettingsModel.installed.client_id) && !string.IsNullOrEmpty(_appSettingsModel.installed.client_secret))
            {
                setDriveServiceAsync().GetAwaiter().GetResult();
            }
        }