private void UpdateToolstipControls() { _currentlySelectedExternalTools.Clear(); _currentlySelectedExternalTools.AddRange(ToolsListObjView.SelectedObjects.OfType <ExternalTool>()); PropertiesGroupBox.Enabled = _currentlySelectedExternalTools.Count == 1; var atleastOneToolSelected = _currentlySelectedExternalTools.Count > 0; DeleteToolMenuItem.Enabled = atleastOneToolSelected; DeleteToolToolstripButton.Enabled = atleastOneToolSelected; LaunchToolMenuItem.Enabled = atleastOneToolSelected; LaunchToolToolstripButton.Enabled = atleastOneToolSelected; }
/// <summary> /// Populate main Customer VM collection /// TBD...needs to be re-populated when new customers added /// /// </summary> public void GetAllCustomerVMs() { customers = GetTVCustomers(); allcustomers.Clear(); foreach (TVCustomerModel cm in customers) { //add customer to tree allcustomers.Add(new TVCustomerViewModel(cm)); } }
public void ClearRemovesAllItems() { var list = new FullyObservableCollection <INotifyPropertyChanged> { Substitute.For <INotifyPropertyChanged>(), Substitute.For <INotifyPropertyChanged>(), Substitute.For <INotifyPropertyChanged>() }; list.Clear(); Assert.That(list, Is.Empty); }
public void ClearList() { TestCollection.Clear(); Expect(TestCollection.Count, Is.EqualTo(0)); Expect(ItemEventList.Count, Is.EqualTo(0), "Item Event count (pre change)"); Expect(CollectionEventList.Count, Is.EqualTo(1), "Collection Event count (pre change)"); Expect(CollectionEventList[0].Action, Is.EqualTo(NotifyCollectionChangedAction.Reset), "Action (reset)"); Expect(CollectionEventList[0].OldItems, Is.Null, "OldItems count"); Expect(CollectionEventList[0].NewItems, Is.Null, "NewItems count"); CollectionEventList.Clear(); // Empty for next operation ItemEventList.Clear(); Fred.Id = 7; Expect(CollectionEventList.Count, Is.EqualTo(0), "Collection Event count (post change)"); Expect(ItemEventList.Count, Is.EqualTo(0), "Item Event count (post change)"); }
private void RefreshOutdata() { if (sourceData == null) { return; } if (outData == null) { return; } outData.Clear(); foreach (var itm in sourceData) { if (selector(itm)) { if (newFunc != null) { outData.Add(newFunc(itm)); } else { if (transformer == null) { outData.Add(itm as TOut); } else { var item = new TOut(); transformer(itm, item); outData.Add(item); } } } } if (orderKeySelector != null && outData != null) { outData.Sort(orderKeySelector); } }
private void SettingsHeader_OnResetClick(object sender, RoutedEventArgs e) { navigationItems.Clear(); LoadNavigationItems(); }