private Disposable Lock(string sourceFile) { if (!_dic.TryGetValue(sourceFile, out BoxWorkflowConfigParser box)) { lock (_lock) if (!_dic.TryGetValue(sourceFile, out box)) { _dic.Add(sourceFile, box = new BoxWorkflowConfigParser() { SourceFile = sourceFile }); } } var d = new Disposable(box); return(d); }
public Disposable(BoxWorkflowConfigParser box) { this.Box = box; this.sourceFile = box.SourceFile; this.Box.Lock(); }