// Change list contents have been updated void OnChangeContents(Task task) { ListItem pendingItem = pendingList.FindItemWithIdentifier(task.userIdentifier); ListItem item = pendingItem == null?incomingList.FindItemWithIdentifier(task.userIdentifier) : pendingItem; if (item == null) { return; } ListControl list = pendingItem == null ? incomingList : pendingList; item.RemoveAll(); AssetList assetList = task.assetList; // Add all files to the list if (assetList.Count == 0) { // Can only happen for pendingList since incoming lists are frozen by design. ListItem empty = list.Add(item, ListControl.c_emptyChangeListMessage, (Asset)null); empty.Dummy = true; } else { foreach (Asset a in assetList) { list.Add(item, a.prettyPath, a); } } list.Refresh(false); // false means the expanded events are not called Repaint(); }
void RefreshList() { resolveList.Clear(); bool first = true; foreach (Asset it in assetList) { ListItem newItem = resolveList.Add(null, it.prettyPath, it); if (first) { resolveList.SelectedSet(newItem); first = false; } else { resolveList.SelectedAdd(newItem); } } // Show a dummy entry if there is nothing to do if (assetList.Count == 0) { ChangeSet change = new ChangeSet("no files to resolve"); ListItem item = resolveList.Add(null, change.description, change); item.Dummy = true; } resolveList.Refresh(); Repaint(); }
private void OnChangeContents(Task task) { ListItem listItem = this.pendingList.FindItemWithIdentifier(task.userIdentifier); ListItem listItem2 = (listItem != null) ? listItem : this.incomingList.FindItemWithIdentifier(task.userIdentifier); if (listItem2 == null) { return; } ListControl listControl = (listItem != null) ? this.pendingList : this.incomingList; listItem2.RemoveAll(); AssetList assetList = task.assetList; if (assetList.Count == 0) { ListItem listItem3 = listControl.Add(listItem2, "Empty change list", null); listItem3.Dummy = true; } else { foreach (Asset current in assetList) { listControl.Add(listItem2, current.prettyPath, current); } } listControl.Refresh(false); base.Repaint(); }
private void OnChangeContents(Task task) { ListItem itemWithIdentifier = this.pendingList.FindItemWithIdentifier(task.userIdentifier); ListItem parent = itemWithIdentifier ?? this.incomingList.FindItemWithIdentifier(task.userIdentifier); if (parent == null) { return; } ListControl listControl = itemWithIdentifier != null ? this.pendingList : this.incomingList; parent.RemoveAll(); AssetList assetList = task.assetList; if (assetList.Count == 0) { listControl.Add(parent, "Empty change list", (Asset)null).Dummy = true; } else { using (List <Asset> .Enumerator enumerator = assetList.GetEnumerator()) { while (enumerator.MoveNext()) { Asset current = enumerator.Current; listControl.Add(parent, current.prettyPath, current); } } } listControl.Refresh(false); this.Repaint(); }
void RefreshList() { submitList.Clear(); foreach (Asset it in assetList) { submitList.Add(null, it.prettyPath, it); } if (assetList.Count == 0) { ChangeSet change = new ChangeSet(ListControl.c_emptyChangeListMessage); ListItem item = submitList.Add(null, change.description, change); item.Dummy = true; } submitList.Refresh(); Repaint(); }
internal void PopulateListControl(ListControl list, Task task, Texture2D icon) { // We try to correct the existing list by removing/adding entries. // This way the entries will keep their children while the children are updated // and will prevent flicker // list.Clear (); // Remove from existing list entries not in the incoming one ChangeSets css = task.changeSets; ListItem it = list.Root.FirstChild; while (it != null) { ChangeSet cs = it.Item as ChangeSet; if (css.Find(elm => elm.id == cs.id) == null) { // Found an list item that was not in the incoming list. // Lets remove it. ListItem rm = it; it = it.Next; list.Root.Remove(rm); } else { it = it.Next; } } // Update the existing ones with the new content or add new ones foreach (ChangeSet change in css) { ListItem changeItem = list.GetChangeSetItem(change); if (changeItem != null) { changeItem.Item = change; changeItem.Name = FormatChangeSetDescription(change); } else { changeItem = list.Add(null, FormatChangeSetDescription(change), change); } changeItem.Exclusive = true; // Single selection only changeItem.CanAccept = true; // Accept drag and drop changeItem.Icon = icon; // changeset icon } // Refresh here will trigger the expand events to ensure the same change lists // are kept open. This will in turn trigger change list contents update requests list.Refresh(); list.Filter = m_SearchText; Repaint(); }
void RefreshList() { revertList.Clear(); foreach (Asset it in assetList) { revertList.Add(null, it.prettyPath, it); } // Show a dummy entry if there is nothing to do if (assetList.Count == 0) { ChangeSet change = new ChangeSet("no files to revert"); ListItem item = revertList.Add(null, change.description, change); item.Dummy = true; } revertList.Refresh(); Repaint(); }
private void PopulateListControl(ListControl list, Task task, Texture2D icon) { ChangeSets changeSets = task.changeSets; ListItem listItem1 = list.Root.FirstChild; while (listItem1 != null) { // ISSUE: object of a compiler-generated type is created // ISSUE: reference to a compiler-generated method if (changeSets.Find(new Predicate <ChangeSet>(new WindowPending.\u003CPopulateListControl\u003Ec__AnonStoreyC1() { cs = listItem1.Item as ChangeSet }.\u003C\u003Em__230)) == null) { ListItem listItem2 = listItem1; listItem1 = listItem1.Next; list.Root.Remove(listItem2); } else { listItem1 = listItem1.Next; } } using (List <ChangeSet> .Enumerator enumerator = changeSets.GetEnumerator()) { while (enumerator.MoveNext()) { ChangeSet current = enumerator.Current; ListItem listItem2 = list.GetChangeSetItem(current); if (listItem2 != null) { listItem2.Item = (object)current; listItem2.Name = current.description; } else { listItem2 = list.Add((ListItem)null, current.description, current); } listItem2.Exclusive = true; listItem2.CanAccept = true; listItem2.Icon = (Texture)icon; } } list.Refresh(); this.Repaint(); }
void OnExpandIncoming(ChangeSet change, ListItem item) { if (!Provider.isActive) { return; } Task task = Provider.IncomingChangeSetAssets(change); task.userIdentifier = item.Identifier; task.SetCompletionAction(CompletionAction.OnChangeContentsPendingWindow); if (!item.HasChildren) { Asset asset = new Asset("Updating..."); ListItem changeItem = incomingList.Add(item, asset.prettyPath, asset); changeItem.Dummy = true; incomingList.Refresh(false); //true here would cause recursion Repaint(); } }
private void RefreshList() { checkoutSuccessList.Clear(); checkoutFailureList.Clear(); foreach (var asset in assetList) { if (asset.IsState(Asset.States.CheckedOutLocal)) { checkoutSuccessList.Add(null, asset.prettyPath, asset); } else { checkoutFailureList.Add(null, asset.prettyPath, asset); } } checkoutSuccessList.Refresh(); checkoutFailureList.Refresh(); Repaint(); }
private void PopulateListControl(ListControl list, Task task, Texture2D icon) { ChangeSets changeSets = task.changeSets; ListItem listItem = list.Root.FirstChild; while (listItem != null) { ChangeSet cs = listItem.Item as ChangeSet; if (changeSets.Find((ChangeSet elm) => elm.id == cs.id) == null) { ListItem listItem2 = listItem; listItem = listItem.Next; list.Root.Remove(listItem2); } else { listItem = listItem.Next; } } foreach (ChangeSet current in changeSets) { ListItem listItem3 = list.GetChangeSetItem(current); if (listItem3 != null) { listItem3.Item = current; listItem3.Name = current.description; } else { listItem3 = list.Add(null, current.description, current); } listItem3.Exclusive = true; listItem3.CanAccept = true; listItem3.Icon = icon; } list.Refresh(); base.Repaint(); }