public int BranchIndexByHash(Guid uuid) { TasBranch branch = Branches.SingleOrDefault(b => b.UniqueIdentifier == uuid); if (branch == null) { return(-1); } return(Branches.IndexOf(branch)); }
public int BranchIndexByFrame(int frame) { TasBranch branch = Branches.Where(b => b.Frame == frame) .OrderByDescending(b => b.TimeStamp).FirstOrDefault(); if (branch == null) { return(-1); } return(Branches.IndexOf(branch)); }
public int BranchIndexByHash(int hash) { TasBranch branch = Branches.SingleOrDefault(b => b.UniqueIdentifier.GetHashCode() == hash); if (branch == null) { return(-1); } return(Branches.IndexOf(branch)); }
public void SwapBranches(int b1, int b2) { TasBranch branch = Branches[b1]; if (b2 >= Branches.Count) { b2 = Branches.Count - 1; } Branches.Remove(branch); Branches.Insert(b2, branch); }
public void UpdateBranch(TasBranch old, TasBranch newBranch) { int index = Branches.IndexOf(old); newBranch.UniqueIdentifier = old.UniqueIdentifier; if (newBranch.UserText == "") { newBranch.UserText = old.UserText; } Branches[index] = newBranch; Changes = true; }
public TasBranch GetBranch(Guid id) { TasBranch branch = Branches.Where(b => b.UniqueIdentifier == id).SingleOrDefault(); if (branch != null) { return(branch); } else { return(null); } }
public void LoadBranch(TasBranch branch) { int?divergentPoint = DivergantPoint(_log, branch.InputLog); _log = branch.InputLog.ToList(); _changes = true; LagLog.FromLagLog(branch.LagLog); StateManager.LoadBranch(Branches.IndexOf(branch)); StateManager.SetState(branch.Frame, branch.CoreData); ChangeLog = branch.ChangeLog; Markers = branch.Markers; }
public void LoadBranch(TasBranch branch) { int?divergentPoint = DivergentPoint(Log, branch.InputLog); Log?.Dispose(); Log = branch.InputLog.Clone(); InvalidateAfter(divergentPoint ?? branch.InputLog.Count); if (BindMarkersToInput) // pretty critical not to erase them { Markers = branch.Markers; } Changes = true; }
public void RemoveBranch(TasBranch branch) { Branches.Remove(branch); Changes = true; }
public void AddBranch(TasBranch branch) { Branches.Add(branch); Changes = true; }
public void RemoveBranch(TasBranch branch) { TasStateManager.RemoveBranch(Branches.IndexOf(branch)); Branches.Remove(branch); Changes = true; }
public void AddBranch(TasBranch branch) { Branches.Add(branch); TasStateManager.AddBranch(); Changes = true; }
public void AddBranch(TasBranch branch) { Branches.Add(branch); TasStateManager.AddBranch(); }