public GeneralController(IRepositoryData repositoryData, IEmailSender emailSender, UserManager <ApplyTriadfsUser> userManager, SignInManager <ApplyTriadfsUser> signInManager) { this.repositoryData = repositoryData; this.emailSender = emailSender; _userManager = userManager; _signInManager = signInManager; _emailSender = emailSender; }
public IRepositoryData LoadFrom(string gitRepository) { IRepositoryDataBuilder builder = _dataBuilderFactory.CreateBuilder(); using (IGitRepository repository = _repositoryFactory.Open(gitRepository)) { PopulateBuilder(builder, repository); } IRepositoryData data = builder.Build(); return(data); }
private async Task <ProjectSourceCodes> GetSourceCodesAsync(IRepositoryData repository) { try { return(await this.repository.GetSourcesAsync(repository)); } catch (Exception e) { error.Status = CodeErrors.HasError; error.Class = $"{nameof(RepositoryContext)}"; error.Method = $"{nameof(GetSourceCodesAsync)}({nameof(IRepositoryData)} repository)"; logger.Error(e, $"GetSourceCodes error in repository [{repository?.Name}]!"); } return(new ProjectSourceCodes { }); }
public ITree Build( IRepositoryData repository, IRemote remoteToUse, IBranchesKnowledge branchesKnowledge, IBranchPickingOptions branchPickingOptions, ITagPickingOptions tagPickingOptions) { ITree tree = new Tree(); tree.SetCommits(repository.Commits); AddBranches(branchesKnowledge, repository.Commits, branchPickingOptions, tree); AddTags(repository.Tags, tagPickingOptions, tree); return(tree); }
public async Task <ProjectSourceCodes> GetSourcesAsync(IRepositoryData repository) { var files = (await GetFiles(repository.Path)).Select(x => new ProjectSourceCodes.File { Name = x.Name, SourceCode = x.Data } ).ToArray(); var project = new ProjectSourceCodes { Files = files }; project.ProjectName = projectName; return(project); }
/// <summary> /// Инициализируем данные игры. /// </summary> public Repository() { GunData = GetRepository <Gun>(StringHelper.NameFiles.GunData); SuspensionsData = GetRepository <Suspension>(StringHelper.NameFiles.SuspensionData); BodyMachinesData = GetRepository <BodyMachine>(StringHelper.NameFiles.BodyMachineData); SavedUserData = GetRepository <UserData>(StringHelper.NameFiles.SavedUserData); if (GunData.TableData.Count == 0) { InsertTestData.AddGunData(this); } if (SuspensionsData.TableData.Count == 0) { InsertTestData.AddSuspensionsData(this); } if (BodyMachinesData.TableData.Count == 0) { InsertTestData.AddBodyMachinesData(this); } }
public IRemote PickRemote(IRepositoryData repository, string remoteToUse) { // We need to return something, so this check is mandatory. if (repository.Remotes.Count == 0) { throw new InvalidOperationException("The repository does not contain remotes."); } if (string.IsNullOrWhiteSpace(remoteToUse)) { // Use default. IRemote originRemote = repository.Remotes.GetRemoteByName("origin"); if (originRemote != null) { return(originRemote); } // Do we have multiple? if (repository.Remotes.Count > 1) { throw new InvalidOperationException( "The repository contains multiple remotes, cannot pick default."); } return(repository.Remotes.Single()); } // Find matching remote by name. IRemote matching = repository.Remotes.GetRemoteByName(remoteToUse); if (matching == null) { throw new InvalidOperationException( $"The repository does not contain a remote named \"{remoteToUse}\"."); } return(matching); }
public NikiMapModel(IRepositoryData repositoryData, IOptions <AppDefaultSetting> options) { this.repositoryData = repositoryData; this.options = options; }
public GestionUtilisateurBol(IRepositoryData repoData) { repo = repoData; }
public UserDataController(IRepositoryData <UserData> userSessionRepo) { _userSessionRepository = new UserSessionRepository(userSessionRepo); }
public UpsertModel(IWebHostEnvironment webHostEnvironment, IRepositoryData repositoryData, BlogmeniaDbContext db) { this.repositoryData = repositoryData; this.webHostEnvironment = webHostEnvironment; this.db = db; }
public GestionCommandeBol(IRepositoryData repoData) { repo = repoData; }
protected override void RunInternal() { // Get the immutable repository information. IRepositoryData repositoryData = _loader.LoadFrom(_repositoryDir.FullName); // Pick the remote to work on. IRemote remoteToUse = _remoteHelper.PickRemote(repositoryData, Options.RemoteToUse); // Create the tree. IBranchingStrategy strategy = _strategyProvider.GetStrategy(Options.LesserBranchesRegex); IBranch[] allBranches = repositoryData.Branches.GetFor(remoteToUse).ToArray(); IBranchesKnowledge branchesKnowledge = strategy.CreateKnowledge(allBranches); // Options for building the tree. ITagPickingOptions tagPickingOptions = TagPickingOptions.Set( Options.TagPickingMode, Options.TagCount, Options.IncludeOrphanedTags); IBranchPickingOptions branchPickingOptions = BranchPickingOptions.Set( Options.IncludeBranchesRegices, Options.ExcludeBranchesRegices); ITree tree = _treeBuilder.Build( repositoryData, remoteToUse, branchesKnowledge, branchPickingOptions, tagPickingOptions); SimplifyTree(tree); string tempPath = _fileSystem.Path.GetTempFileName(); tempPath = _fileSystem.Path.ChangeExtension(tempPath, "gv"); // Rendering options. TreeRenderingOptions renderingOptions = TreeRenderingOptions.Default; renderingOptions.ForceTreatAsGitHub = Options.ForceTreatAsGitHub; // ReSharper disable once AssignNullToNotNullAttribute using (IFileStream fileStream = _fileSystem.File.OpenWrite(tempPath)) { using (IStreamWriter textWriter = _textWriterFactory.CreateStreamWriter(fileStream)) { IGraphVizWriter graphVizWriter = _graphVizFactory.CreateGraphVizWriter(textWriter); ITreeRenderer treeRenderer = _treeRendererFactory.CreateRenderer(graphVizWriter); treeRenderer.Render(tree, remoteToUse, branchesKnowledge, renderingOptions); } } string targetPath = PrepareTargetPath(); string graphVizCommand = _appPathProvider.GetProperAppPath(ExternalApp.GraphViz); string graphVizArgs = $@"""{tempPath}"" -T{_outputFormat} -o""{targetPath}"""; Log.Debug($"Starting GraphViz with arguments: [{graphVizArgs}]."); int code = _processRunner.Execute(graphVizCommand, graphVizArgs); if (code != 0) { Log.Fatal("GraphViz execution failed."); } else { Log.Info("GraphViz execution succeeded."); Log.Info($"Saved to {targetPath}."); } }
public IndexModel(IRepositoryData repositoryData, IOptions <AppDefaultSetting> ioptions) { this.repositoryData = repositoryData; this.ioptions = ioptions; }
public SubscribersController(IRepositoryData repositoryData) { this.repositoryData = repositoryData; }
public IndexModel(IRepositoryData repositoryData) { this.repositoryData = repositoryData; }
public MongoDbService() { _ctx = new MongoDbData("chipinoDB"); }
public clsCommon(IRepositoryData repositoryData) { this.repositoryData = repositoryData; }
public CommentsController(IRepositoryData repositoryData) { this.repositoryData = repositoryData; }
public AuthorizationController(IRepositoryData <UserData> userSessionRepo) { _userSessionRepository = new UserSessionRepository(userSessionRepo); }
public BaseApiController(IRepositoryData data) { this.Data = data; }
public UpsertModel(IRepositoryData repositoryData) { this.repositoryData = repositoryData; }
public DummyService() { _ctx = new DummyData(); }
public IndexModel(ILogger <IndexModel> logger, IRepositoryData repositoryData, IOptions <AppDefaultSetting> options) { _logger = logger; this.repositoryData = repositoryData; this.options = options; }
public PostsController(BlogmeniaDbContext context, IRepositoryData repositoryData) { _context = context; this.repositoryData = repositoryData; }
public GestionCatalogueBol(IRepositoryData repoData) { repo = repoData; }
/// <summary> /// Инициализируется репозиторий. /// </summary> /// <param name="repository">Репозиторий.</param> public UserSessionRepository(IRepositoryData <UserData> repository) { _repository = repository ?? throw new ArgumentNullException(nameof(repository)); }
public IndexModel(IRepositoryData repositoryData, IOptions <AppDefaultSetting> option) { this.repositoryData = repositoryData; this.option = option; }