コード例 #1
0
        private static GSDService CreateService(JsonTracer tracer, string[] args)
        {
            string serviceName = args.FirstOrDefault(arg => arg.StartsWith(GSDService.ServiceNameArgPrefix, StringComparison.OrdinalIgnoreCase));

            if (serviceName != null)
            {
                serviceName = serviceName.Substring(GSDService.ServiceNameArgPrefix.Length);
            }
            else
            {
                serviceName = GSDConstants.Service.ServiceName;
            }

            GSDPlatform gvfsPlatform = GSDPlatform.Instance;

            string logFilePath = Path.Combine(
                gvfsPlatform.GetDataRootForGSDComponent(serviceName),
                GSDConstants.Service.LogDirectory);

            Directory.CreateDirectory(logFilePath);

            tracer.AddLogFileEventListener(
                GSDEnlistment.GetNewGSDLogFileName(logFilePath, GSDConstants.LogFileTypes.Service),
                EventLevel.Informational,
                Keywords.Any);

            string       serviceDataLocation = gvfsPlatform.GetDataRootForGSDComponent(serviceName);
            RepoRegistry repoRegistry        = new RepoRegistry(
                tracer,
                new PhysicalFileSystem(),
                serviceDataLocation,
                new GSDMountProcess(tracer),
                new NotificationHandler(tracer));

            return(new GSDService(tracer, serviceName, repoRegistry));
        }
コード例 #2
0
 public static void Initialize()
 {
     GSDPlatform.Register(new WindowsPlatform());
     return;
 }
コード例 #3
0
ファイル: Setup.cs プロジェクト: derrickstolee/VFSForGit
 public void SetUp()
 {
     GSDPlatform.Register(new MockPlatform());
 }