void OnServicesChanged(ServicesChangedEventArgs args)
		{
			var handler = this.ServicesChanged;
			if (handler != null) {
				handler (this, args);
			}
		}
示例#2
0
        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;
            }
        }
示例#4
0
        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;
            }
        }
示例#5
0
        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;
			}
		}