示例#1
0
 /************************ Construction ***********************************/
 /*----------------------- GitContext ------------------------------------*/
 /// <summary>
 /// Injection constructor
 /// </summary>
 /// <param name="localFactory">
 /// Local repository factory
 /// </param>
 /// <param name="remoteFactory">
 /// Remote repository factory
 /// </param>
 /// <param name="gitExec">
 /// Git executor
 /// </param>
 /// <param name="lfsExec">
 /// LFS executor
 /// </param>
 public GitContext(
     IGitCacheConfiguration gitCacheConfiguration,
     ILocalRepositoryFactory localFactory,
     IRemoteRepositoryFactory remoteFactory,
     IGitExecuter gitExec,
     IGitLFSExecuter lfsExec)
 {
     if (null == (Configuration = gitCacheConfiguration))
     {
         throw new ArgumentNullException(nameof(gitCacheConfiguration), "Missing git-cache configuration");
     }
     if (null == (LocalFactory = localFactory))
     {
         throw new ArgumentNullException(nameof(localFactory), "Missing required local repository factory");
     }
     if (null == (RemoteFactory = remoteFactory))
     {
         throw new ArgumentNullException(nameof(remoteFactory), "Remote repository factory must be valid");
     }
     if (null == (GitExecuter = gitExec))
     {
         throw new ArgumentNullException(nameof(gitExec), "Git executor must be valid");
     }
     if (null == (LFSExecuter = lfsExec))
     {
         throw new ArgumentNullException(nameof(lfsExec), "LFS executor must be valid");
     }
 } /* End of Function - GitContext */
 /*======================= PUBLIC ========================================*/
 /************************ Events *****************************************/
 /************************ Properties *************************************/
 /************************ Construction ***********************************/
 /*----------------------- GitAuthorizationCheckFilterAttribute ----------*/
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="factory">
 /// Factory for creating the remote repository objects
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// If the factory is null
 /// </exception>
 public GitAuthorizationCheckFilterAttribute(IRemoteRepositoryFactory factory)
 {
     if (null == (m_factory = factory))
     {
         throw new ArgumentNullException(nameof(factory), "Must provide a valid factory class");
     }
 } /* End of Function - GitAuthorizationCheckFilterAttribute */