public ApplicationConfiguration() { Editor = new EditorConfiguration(); Git = new GitConfiguration(); Images = new ImagesConfiguration(); MarkdownOptions = new MarkdownOptionsConfiguration(); WindowPosition = new WindowPositionConfiguration(); FolderBrowser = new FolderBrowserConfiguration(); ApplicationUpdates = new ApplicationUpdatesConfiguration(); OpenDocuments = new List <OpenFileDocument>(); InternalCommonFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Markdown Monster"); CommonFolder = InternalCommonFolder; LastFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); PreviewSyncMode = PreviewSyncMode.EditorToPreview; AutoSaveBackups = true; AutoSaveDocuments = false; RecentDocumentsLength = 10; RememberLastDocumentsLength = 5; //BugReportUrl = "https://markdownmonster.west-wind.com/bugreport/bugreport.ashx?method=ReportBug"; //BugReportUrl = "http://localhost.fiddler/MarkdownMonster/bugreport/bugreport.ashx?method=ReportBug"; //TelemetryUrl = "https://markdownmonster.west-wind.com/bugreport/bugreport.ashx?method=Telemetry"; SendTelemetry = true; ApplicationTheme = Themes.Dark; PreviewTheme = "Dharkan"; EditorTheme = "vscodedark"; DefaultCodeSyntax = "csharp"; PreviewHttpLinksExternal = true; UseMachineEncryptionKeyForPasswords = true; TerminalCommand = "powershell.exe"; TerminalCommandArgs = "-noexit -command \"cd '{0}'\""; OpenFolderCommand = "explorer.exe"; WebBrowserPreviewExecutable = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"Google\Chrome\Application\chrome.exe"); ReportErrors = true; UseSingleWindow = true; IsPreviewVisible = true; IsDocumentOutlineVisible = true; OpenInPresentationMode = false; AlwaysUsePreviewRefresh = false; // Disable for better stability and compatibility // We're not doing anything that pushes the hardware to bring benefits DisableHardwareAcceleration = true; }
public ApplicationConfiguration() { Editor = new EditorConfiguration(); Git = new GitConfiguration(); Images = new ImagesConfiguration(); MarkdownOptions = new MarkdownOptionsConfiguration(); WindowPosition = new WindowPositionConfiguration(); FolderBrowser = new FolderBrowserConfiguration(); ApplicationUpdates = new ApplicationUpdatesConfiguration(); PdfOutputWindow = new PdfOutputConfiguration(); WebServer = new WebServerConfiguration(); System = new SystemConfiguration(); OpenDocuments = new List <OpenFileDocument>(); // Make sure common folder points at AppData\Markdown Monster or PortableSettings InternalCommonFolder = FindCommonFolder(); CommonFolder = InternalCommonFolder; LastFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); PreviewSyncMode = PreviewSyncMode.EditorToPreview; AutoSaveBackups = true; AutoSaveDocuments = false; RecentDocumentsLength = 10; RememberLastDocumentsLength = 5; //BugReportUrl = "https://markdownmonster.west-wind.com/bugreport/bugreport.ashx?method=ReportBug"; //BugReportUrl = "http://localhost.fiddler/MarkdownMonster/bugreport/bugreport.ashx?method=ReportBug"; //TelemetryUrl = "https://markdownmonster.west-wind.com/bugreport/bugreport.ashx?method=Telemetry"; ApplicationTheme = Themes.Dark; PreviewTheme = "Dharkan"; EditorTheme = "vscodedark"; DefaultCodeSyntax = "csharp"; PreviewHttpLinksExternal = true; UseMachineEncryptionKeyForPasswords = true; TerminalCommand = "powershell.exe"; TerminalCommandArgs = "-noexit -command \"cd '{0}'\""; OpenFolderCommand = "explorer.exe"; WebBrowserPreviewExecutable = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"Google\Chrome\Application\chrome.exe"); UseSingleWindow = true; IsPreviewVisible = true; IsDocumentOutlineVisible = true; OpenInPresentationMode = false; AlwaysUsePreviewRefresh = false; }
public GitLazyConfig(GitConfiguration config) { Configuration = config ?? throw new ArgumentNullException(nameof(config)); _repositoryIsLazy = new Lazy <bool>(GetRepositoryIsLazy); _repositoryIsShallow = new Lazy <bool>(GetRepositoryIsShallow); _repositoryCommitGraph = new Lazy <bool>(GetRepositoryCommitGraph); _repositorySupportsMultiPack = new Lazy <bool>(GetRepositorySupportsMultiPack); _autoGCBlobs = new Lazy <int>(GetAutGCBlobs); }
public void HaveShellClient() { Assert.IsNotNull(GitConfiguration.GitProgramPath); Assert.IsTrue(File.Exists(GitConfiguration.GitProgramPath)); foreach (var v in GitConfiguration.GetGitConfigurationFilePaths(true)) { TestContext.WriteLine(v); } }
public void CreateGitRepository() { string dir = GetTempPath(); string file = Path.Combine(dir, "file"); using (GitRepository repo = GitRepository.Create(dir)) { Assert.That(repo, Is.Not.Null); Assert.That(repo.IsEmpty, Is.True); Assert.That(repo.IsBare, Is.False); Assert.That(repo.RepositoryDirectory, Is.EqualTo(Path.Combine(dir, GitClient.AdministrativeDirectoryName))); Assert.That(repo.WorkingCopyDirectory, Is.EqualTo(dir)); GitConfiguration config = repo.Configuration; Assert.That(config, Is.Not.Null); GitIndex index = repo.Index; Assert.That(index, Is.Not.Null); //repo.SetIndex(index); GitObjectDatabase odb = repo.ObjectDatabase; Assert.That(odb, Is.Not.Null); //repo.SetObjectDatabase(odb); File.WriteAllText(file, "qqq"); repo.Index.Add("file"); Assert.That(repo.Configuration.Set(GitConfigurationLevel.Repository, GitConfigurationKeys.UserName, "Tester")); Assert.That(repo.Configuration.Set(GitConfigurationLevel.Repository, GitConfigurationKeys.UserEmail, "[email protected]")); string v; Assert.That(repo.Configuration.TryGetString(GitConfigurationKeys.UserName, out v)); Assert.That(v, Is.EqualTo("Tester")); Assert.That(repo.Configuration.TryGetString(GitConfigurationKeys.UserEmail, out v)); Assert.That(v, Is.EqualTo("[email protected]")); Assert.That(index.Contains("file")); GitIndexEntry entry = repo.Index["file"]; Assert.That(entry, Is.Not.Null); Assert.That(entry.FileSize, Is.EqualTo(3)); Assert.That(entry.Id, Is.EqualTo(new GitId("E5A49F32170B89EE4425C4AB09E70DFCDB93E174"))); index.Reload(); Assert.That(index.Contains("file"), Is.False); } }
public bool TryGetSetting(string envarName, string section, string property, out string value) { value = null; if (Environment?.Variables.TryGetValue(envarName, out value) ?? false) { return(true); } if (GitConfiguration?.TryGet($"{section}.{property}", out value) ?? false) { return(true); } return(false); }
private static void Upload(string[] args) { if (args.Length < 2) { Usage(); return; } var myArgs = new string[4]; Array.Copy(args.ToArray(), myArgs, Math.Min(args.Length, myArgs.Length)); var config = new GitConfiguration(); var upload = new Downloads(myArgs[1], myArgs[2] ?? config.GetValue("github.user"), myArgs[3] ?? config.GetValue("github.token")); Console.WriteLine(upload.AddFile(myArgs[0])); }
internal VBAGitAddinApp(VBE vbe) { _vbe = vbe; _configService = new VBAGitConfigurationService(); _config = _configService.LoadConfiguration(); _changedFiles = new List <RepositoryFile>(); _repoWatchers = new List <RepositoryFileWatcher>(); _timer = new Timer(); _timer.Interval = 1000; _timer.Tick += _timer_Tick; _timer.Start(); _vbe.VBProjects.Cast <VBProject>() .ToList().ForEach(p => AddVBProject(p)); }
public IEnumerable <string> GetSettingValues(string envarName, string section, string property) { string envarValue = null; if (Environment?.Variables.TryGetValue(envarName, out envarValue) ?? false) { yield return(envarValue); } foreach (string scope in RemoteUri.GetGitConfigurationScopes()) { string key = $"{section}.{scope}.{property}"; IEnumerable <string> configValues = GitConfiguration.GetAll(key); foreach (string value in configValues) { yield return(value); } } }
public static IServiceProvider BuildServiceProvider() { var services = new ServiceCollection(); var dotNetConfig = new DotNetConfiguration(); var iisConfig = new IISMangementConfiguration(); var gitConfig = new GitConfiguration(); services .AddSingleton(dotNetConfig) .AddSingleton(iisConfig) .AddSingleton(gitConfig); services .AddSingleton <IAppService, AppService>() .AddSingleton <INotificationService, NotificationService>() .AddSingleton <IRepositoryService, RepositoryService>() .AddSingleton <ISiteService, SiteService>(); services .AddSingleton <IGitService, GitService>() .AddSingleton <IDotNetPublishService, DotNetPublishService>() .AddSingleton <ISiteManagementService, SiteManagementService>(); services .AddSingleton <MainWindowViewModel>(); services .AddSingleton <IAppViewModelFactory, AppViewModelFactory>() .AddSingleton <IAppListViewModelFactory, AppListViewModelFactory>(); services .AddTransient <MainWindow>(); return(services.BuildServiceProvider()); }
public GitService(IOptions <GitConfiguration> configuration) { _configuration = configuration.Value; HttpClient = RegisterHttpClient(); }
public GitService(GitConfiguration configuration) { this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); }