Example #1
0
        private RoslynDiagramNodeHeaderViewModelBase CreateDiagramNodeHeaderUi([NotNull] ISymbol symbol)
        {
            RoslynDiagramNodeHeaderViewModelBase result = symbol switch
            {
                INamedTypeSymbol _ => new RoslynTypeDiagramNodeHeaderViewModel(symbol, _roslynSymbolTranslator, IsDescriptionVisible),
                _ => new RoslynMemberDiagramNodeHeaderViewModel(symbol, _roslynSymbolTranslator)
            };

            return(result);
        }
    }
Example #2
0
 public RoslynDiagramNodeViewModel(
     [NotNull] IModelEventSource modelEventSource,
     [NotNull] IDiagramEventSource diagramEventSource,
     [NotNull] IDiagramNode diagramNode,
     bool isDescriptionVisible,
     [NotNull] RoslynDiagramNodeHeaderViewModelBase header,
     [NotNull][ItemNotNull] List <RelatedNodeCueViewModel> relatedCueViewModels)
     : base(
         modelEventSource,
         diagramEventSource,
         diagramNode,
         header,
         relatedCueViewModels)
 {
     _isDescriptionVisible = isDescriptionVisible;
     Name = diagramNode.Name;
 }
Example #3
0
 public RoslynDiagramNodeViewModel(
     [NotNull] IModelEventSource modelEventSource,
     [NotNull] IDiagramEventSource diagramEventSource,
     [NotNull] IDiagramNode diagramNode,
     [NotNull] IRelatedNodeTypeProvider relatedNodeTypeProvider,
     [NotNull] IWpfFocusTracker <IDiagramShapeUi> focusTracker,
     bool isDescriptionVisible,
     [NotNull] ISymbol symbol,
     RoslynDiagramNodeHeaderViewModelBase header)
     : base(
         modelEventSource,
         diagramEventSource,
         diagramNode,
         relatedNodeTypeProvider,
         focusTracker,
         header)
 {
     _isDescriptionVisible = isDescriptionVisible;
     _symbol = symbol;
     Name    = symbol.GetName();
 }