Exemplo n.º 1
0
 public GeneralController(IRepositoryData repositoryData, IEmailSender emailSender, UserManager <ApplyTriadfsUser> userManager,
                          SignInManager <ApplyTriadfsUser> signInManager)
 {
     this.repositoryData = repositoryData;
     this.emailSender    = emailSender;
     _userManager        = userManager;
     _signInManager      = signInManager;
     _emailSender        = emailSender;
 }
Exemplo n.º 2
0
        public IRepositoryData LoadFrom(string gitRepository)
        {
            IRepositoryDataBuilder builder = _dataBuilderFactory.CreateBuilder();

            using (IGitRepository repository = _repositoryFactory.Open(gitRepository))
            {
                PopulateBuilder(builder, repository);
            }

            IRepositoryData data = builder.Build();

            return(data);
        }
Exemplo n.º 3
0
        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 {
            });
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        /// <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);
            }
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
 public NikiMapModel(IRepositoryData repositoryData, IOptions <AppDefaultSetting> options)
 {
     this.repositoryData = repositoryData;
     this.options        = options;
 }
Exemplo n.º 9
0
 public GestionUtilisateurBol(IRepositoryData repoData)
 {
     repo = repoData;
 }
Exemplo n.º 10
0
 public UserDataController(IRepositoryData <UserData> userSessionRepo)
 {
     _userSessionRepository = new UserSessionRepository(userSessionRepo);
 }
Exemplo n.º 11
0
 public UpsertModel(IWebHostEnvironment webHostEnvironment, IRepositoryData repositoryData, BlogmeniaDbContext db)
 {
     this.repositoryData     = repositoryData;
     this.webHostEnvironment = webHostEnvironment;
     this.db = db;
 }
Exemplo n.º 12
0
 public GestionCommandeBol(IRepositoryData repoData)
 {
     repo = repoData;
 }
Exemplo n.º 13
0
        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}.");
            }
        }
Exemplo n.º 14
0
 public IndexModel(IRepositoryData repositoryData, IOptions <AppDefaultSetting> ioptions)
 {
     this.repositoryData = repositoryData;
     this.ioptions       = ioptions;
 }
Exemplo n.º 15
0
 public SubscribersController(IRepositoryData repositoryData)
 {
     this.repositoryData = repositoryData;
 }
Exemplo n.º 16
0
 public IndexModel(IRepositoryData repositoryData)
 {
     this.repositoryData = repositoryData;
 }
Exemplo n.º 17
0
 public MongoDbService()
 {
     _ctx = new MongoDbData("chipinoDB");
 }
Exemplo n.º 18
0
 public clsCommon(IRepositoryData repositoryData)
 {
     this.repositoryData = repositoryData;
 }
Exemplo n.º 19
0
 public CommentsController(IRepositoryData repositoryData)
 {
     this.repositoryData = repositoryData;
 }
 public AuthorizationController(IRepositoryData <UserData> userSessionRepo)
 {
     _userSessionRepository = new UserSessionRepository(userSessionRepo);
 }
Exemplo n.º 21
0
 public BaseApiController(IRepositoryData data)
 {
     this.Data = data;
 }
Exemplo n.º 22
0
 public UpsertModel(IRepositoryData repositoryData)
 {
     this.repositoryData = repositoryData;
 }
Exemplo n.º 23
0
 public DummyService()
 {
     _ctx = new DummyData();
 }
Exemplo n.º 24
0
 public IndexModel(ILogger <IndexModel> logger, IRepositoryData repositoryData, IOptions <AppDefaultSetting> options)
 {
     _logger             = logger;
     this.repositoryData = repositoryData;
     this.options        = options;
 }
Exemplo n.º 25
0
 public PostsController(BlogmeniaDbContext context, IRepositoryData repositoryData)
 {
     _context            = context;
     this.repositoryData = repositoryData;
 }
Exemplo n.º 26
0
 public GestionCatalogueBol(IRepositoryData repoData)
 {
     repo = repoData;
 }
Exemplo n.º 27
0
 /// <summary>
 /// Инициализируется репозиторий.
 /// </summary>
 /// <param name="repository">Репозиторий.</param>
 public UserSessionRepository(IRepositoryData <UserData> repository)
 {
     _repository = repository ?? throw new ArgumentNullException(nameof(repository));
 }
Exemplo n.º 28
0
 public IndexModel(IRepositoryData repositoryData, IOptions <AppDefaultSetting> option)
 {
     this.repositoryData = repositoryData;
     this.option         = option;
 }