예제 #1
0
        private static IReadOnlyList <AssemblyDebugSourceDocumentViewModel> CreateSourcesViewModels(AssemblyDebugData debugData)
        {
            var list = new List <AssemblyDebugSourceDocumentViewModel>(debugData.Sources.Count);

            var lookup = debugData.SourceLink.ToDictionary(sm => sm.Base.Substring(0, sm.Base.Length - 1), sm => sm.Location.Substring(0, sm.Location.Length - 1));

            foreach (var doc in debugData.Sources)
            {
                var    path     = doc.Name;
                string location = null;
                // see if any keys match the base
                foreach (var key in lookup.Keys)
                {
                    if (doc.Name.StartsWith(key, StringComparison.Ordinal))
                    {
                        path     = doc.Name.Substring(key.Length);
                        location = lookup[key] + path;

                        break;
                    }
                }

                list.Add(new AssemblyDebugSourceDocumentViewModel(doc, path, location));
            }

            return(list);
        }
        private static IReadOnlyList <AssemblyDebugSourceDocumentViewModel> CreateSourcesViewModels(AssemblyDebugData debugData)
        {
            var list = new List <AssemblyDebugSourceDocumentViewModel>(debugData.Sources.Count);

            foreach (var doc in debugData.Sources)
            {
                list.Add(new AssemblyDebugSourceDocumentViewModel(doc, doc.Name, doc.Url, doc.IsEmbedded));
            }

            return(list);
        }
예제 #3
0
 public AssemblyDebugDataViewModel(AssemblyDebugData debugData)
 {
     _debugData = debugData ?? throw new ArgumentNullException(nameof(debugData));
     Sources    = CreateSourcesViewModels(debugData);
 }
예제 #4
0
        private static IReadOnlyList <AssemblyDebugSourceDocumentViewModel> CreateSourcesViewModels(AssemblyDebugData debugData)
        {
            var list = new List <AssemblyDebugSourceDocumentViewModel>(debugData.Sources.Count);

            var lookup = debugData.SourceLink.ToDictionary(sm => sm.Base[0..^ 1], sm => sm.Location[0..^ 1]);