public int BranchIndexByHash(Guid uuid) { TasBranch branch = Branches.SingleOrDefault(b => b.UniqueIdentifier == uuid); if (branch == null) { return(-1); } return(Branches.IndexOf(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 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 void AddBranch(BranchVM branch) { int index = Branches.IndexOf(branch); //Add ELSE IF ~ THEN ~ BranchVM elseIfBranch = new BranchVM(BranchVM.TYPE_ELSE_IF_CODE) { Parent = this, IsNew = true }; elseIfBranch.Init(); branches.Insert(index + 1, elseIfBranch); OnBranchOrderChanged(); Editor.Dispatcher.BeginInvoke( DispatcherPriority.Background, new Action(() => { elseIfBranch.EditBranch(); })); }