示例#1
0
        /// <summary>Initializes the view model. Must only be called once per view model instance
        /// (after the InitializeComponent method of a <see cref="!:UserControl"/>). </summary>
        public override async void Initialize()
        {
            List <ProjectModel> projects = null;

            await RunTaskAsync(token => Task.Run(() =>
            {
                if (Application != null)
                {
                    if (Application.Solution != null)
                    {
                        projects = GetAllProjects(Application.Solution.Projects.OfType <Project>());
                    }
                }
            }, token));

            Projects.Initialize(projects);
            _transformations.Initialize(projects
                                        .SelectMany(p => p.NuGetReferences)
                                        .GroupBy(r => r.Name)
                                        .Select(g => new FromNuGetToProjectTransformation(projects, g.First()))
                                        .OrderBy(s => s.FromAssemblyName));
            FilteredTransformations.Initialize(_transformations);
        }
示例#2
0
 /// <summary>Shows only transformations that contains searchText in their Assembly name. </summary>
 internal void FilterTransofrmations(string searchText)
 {
     FilteredTransformations.Initialize(_transformations
                                        .Where(t => t.FromAssemblyName.ToLowerInvariant().Contains(searchText.ToLowerInvariant())));
 }