本文整理汇总了C#中IOperationLock类的典型用法代码示例。如果您正苦于以下问题:C# IOperationLock类的具体用法?C# IOperationLock怎么用?C# IOperationLock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IOperationLock类属于命名空间,在下文中一共展示了IOperationLock类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Tracer
public Tracer(IFileSystem fileSystem, string path, TraceLevel level, IOperationLock traceLock)
{
_fileSystem = fileSystem;
_path = path;
_level = level;
_traceLock = traceLock;
}
示例2: Open
public static DeploymentStatusFile Open(string id, IEnvironment environment, IAnalytics analytics, IOperationLock statusLock)
{
return statusLock.LockOperation(() =>
{
string path = Path.Combine(environment.DeploymentsPath, id, StatusFile);
if (!FileSystemHelpers.FileExists(path))
{
return null;
}
try
{
XDocument document = null;
using (var stream = FileSystemHelpers.OpenRead(path))
{
document = XDocument.Load(stream);
}
return new DeploymentStatusFile(id, environment, statusLock, document);
}
catch (Exception ex)
{
// in the scenario where w3wp is abruptly terminated while xml is being written,
// we may end up with corrupted xml. we will handle the error and remove the problematic directory.
analytics.UnexpectedException(ex);
FileSystemHelpers.DeleteDirectorySafe(Path.GetDirectoryName(path), ignoreErrors: true);
// it is ok to return null as callers already handle null.
return null;
}
}, DeploymentStatusManager.LockTimeout);
}
示例3: ReceivePackHandler
public ReceivePackHandler(ITracer tracer,
IGitServer gitServer,
IOperationLock deploymentLock,
IDeploymentManager deploymentManager,
IDeploymentSettingsManager settings)
: base(tracer, gitServer, deploymentLock, deploymentManager, settings)
{
}
示例4: DeploymentController
public DeploymentController(ITracer tracer,
IDeploymentManager deploymentManager,
IOperationLock deploymentLock)
{
_tracer = tracer;
_deploymentManager = deploymentManager;
_deploymentLock = deploymentLock;
}
示例5: ReceivePackService
public ReceivePackService(ITracer tracer,
IGitServer gitServer,
IOperationLock deploymentLock)
{
_gitServer = gitServer;
_tracer = tracer;
_deploymentLock = deploymentLock;
}
示例6: LiveScmEditorController
public LiveScmEditorController(ITracer tracer,
IDeploymentManager deploymentManager,
IOperationLock operationLock,
IEnvironment environment,
IRepository repository)
: this(tracer, deploymentManager, operationLock, environment, repository, new FileSystem())
{
}
示例7: DeploymentService
public DeploymentService(ITracer tracer,
IDeploymentManager deploymentManager,
IOperationLock deploymentLock)
{
_tracer = tracer;
_deploymentManager = deploymentManager;
_deploymentLock = deploymentLock;
}
示例8: RpcController
public RpcController(ITracer tracer,
IGitServer gitServer,
IOperationLock deploymentLock)
{
_gitServer = gitServer;
_tracer = tracer;
_deploymentLock = deploymentLock;
}
示例9: GitExeServer
public GitExeServer(string path, IOperationLock initLock, ITraceFactory traceFactory)
{
_gitExe = new GitExecutable(path);
_gitExe.SetTraceLevel(2);
_traceFactory = traceFactory;
_repository = new GitExeRepository(path, traceFactory);
_repository.SetTraceLevel(2);
_initLock = initLock;
}
示例10: DeploymentStatusManager
public DeploymentStatusManager(IEnvironment environment,
IAnalytics analytics,
IOperationLock statusLock)
{
_environment = environment;
_analytics = analytics;
_statusLock = statusLock;
_activeFile = Path.Combine(environment.DeploymentsPath, Constants.ActiveDeploymentFile);
}
示例11: ReceivePackHandler
public ReceivePackHandler(ITracer tracer,
IGitServer gitServer,
IOperationLock deploymentLock,
IDeploymentManager deploymentManager,
IRepositoryFactory repositoryFactory)
: base(tracer, gitServer, deploymentLock, deploymentManager)
{
_repositoryFactory = repositoryFactory;
}
示例12: DeploymentStatusManager
public DeploymentStatusManager(IEnvironment environment,
IFileSystem fileSystem,
IOperationLock statusLock)
{
_environment = environment;
_fileSystem = fileSystem;
_statusLock = statusLock;
_activeFile = Path.Combine(environment.DeploymentCachePath, Constants.ActiveDeploymentFile);
}
示例13: RpcService
public RpcService(ITracer tracer,
IGitServer gitServer,
IDeploymentManagerFactory deploymentManagerFactory,
IOperationLock deploymentLock)
{
_gitServer = gitServer;
_deploymentManagerFactory = deploymentManagerFactory;
_tracer = tracer;
_deploymentLock = deploymentLock;
}
示例14: DeploymentController
public DeploymentController(ITracer tracer,
IDeploymentManager deploymentManager,
IOperationLock deploymentLock,
RepositoryFactory repositoryFactory)
{
_tracer = tracer;
_deploymentManager = deploymentManager;
_deploymentLock = deploymentLock;
_repositoryFactory = repositoryFactory;
}
示例15: LiveScmEditorController
public LiveScmEditorController(ITracer tracer,
IOperationLock operationLock,
IEnvironment environment,
IRepository repository)
: base(tracer, environment, environment.RepositoryPath)
{
_operationLock = operationLock;
_repository = repository;
_currentEtag = GetCurrentEtag();
}