void OnServicesChanged(ServicesChangedEventArgs args) { var handler = this.ServicesChanged; if (handler != null) { handler (this, args); } }
void OnServicesChanged(ServicesChangedEventArgs args) { var handler = this.ServicesChanged; if (handler != null) { handler(this, args); } }
/// <summary> /// Handles the services that have been added to the project by updating the services node /// </summary> void ServicesChanged(object sender, ServicesChangedEventArgs e) { ITreeBuilder builder = Context.GetTreeBuilder(sender); if (builder != null) { builder.UpdateAll(); builder.Expanded = true; } }
private void OnServiceChanged(object sender, PropertyChangedEventArgs eventArgs) { switch (eventArgs.PropertyName) { case "Selected": var serviceViewModel = sender as ServiceViewModel; if (serviceViewModel == null) { return; } var args = new ServicesChangedEventArgs(serviceViewModel.Name, serviceViewModel.Selected); SelectedServicesChanged?.Invoke(this, args); break; } }
private void OnSelectedServicesChanged(object sender, ServicesChangedEventArgs servicesChangedEventArgs) { foreach (var unselectedServiceName in servicesChangedEventArgs.ServicesUnSelected) { var service = Services.FirstOrDefault(s => s.Name == unselectedServiceName); if (service == null) { break; } Services.Remove(service); } foreach (var selectedServiceName in servicesChangedEventArgs.ServicesSelected) { var service = new ServiceViewModel(new WindowsServiceMonitor(selectedServiceName)); Services.Add(service); } }
/// <summary> /// Handles the services that have been added to the project by updating the services node /// </summary> void ServicesChanged (object sender, ServicesChangedEventArgs e) { ITreeBuilder builder = Context.GetTreeBuilder (sender); if (builder != null) { builder.UpdateAll (); builder.Expanded = true; } }