private static bool CreateVersionControl <T>(Func <T> factory, string workDirectory, out IVersionControlCommands uvc) where T : IVersionControlCommands { var watch = new System.Diagnostics.Stopwatch(); watch.Start(); uvc = null; bool valid = false; try { uvc = AddDecorators(factory()); uvc.SetWorkingDirectory(workDirectory); valid = uvc.HasValidLocalCopy(); } catch (Exception e) { DebugLog.ThrowException(e); } finally { if (!valid && uvc != null) { uvc.Dispose(); } } DebugLog.Log("CreateVersionControl took : " + watch.ElapsedMilliseconds + "ms"); return(valid); }
private void OnVersionControlBackendChanged(IVersionControlCommands newVcc) { if (vcc != null) { vcc.Dispose(); } vcc = newVcc; vcc.ProgressInformation += progress => { if (ProgressInformation != null) { OnNextUpdate.Do(() => ProgressInformation(progress)); } }; vcc.StatusCompleted += OnStatusCompleted; OnNextUpdate.Do(Start); EditorApplication.playModeStateChanged += OnPlaymodeStateChanged; }
public void Dispose() { vcc.Dispose(); }
public void Dispose() { vcc.Dispose(); vcc = null; }