Наследование: GraphItemViewModel
Пример #1
0
 public LineViewModel(SyntaxViewModel syntaxViewModel)
 {
     _syntaxViewModel = syntaxViewModel;
 }
    private void SelectedItemChanged()
    {

        GeneratorDrawers.Clear();
        fileGenerators = null;

        SelectedNode = InvertGraphEditor.CurrentDiagramViewModel.SelectedGraphItem;

        if (SelectedNode == null)
        {
            return;
        }
        //Issues = SelectedNode.Issues.Any(p => p.Siverity == ValidatorType.Error);
        //if (Issues) return;
        var item = SelectedNode == null ? null : SelectedNode.DataObject;
        
        fileGenerators = InvertGraphEditor.GetAllFileGenerators(InvertApplication.Container.Resolve<IGraphConfiguration>(), new [] {item as IDataRecord}, true).ToArray();

        foreach (var fileGenerator in fileGenerators)
        {
            var list = fileGenerator.Generators.ToList();
            if (item != null)
                list.RemoveAll(p => p.ObjectData != item);
            fileGenerator.Generators = list.ToArray();
            if (fileGenerator.Generators.Length < 1) continue;

            var syntaxViewModel = new SyntaxViewModel(fileGenerator.ToString(), fileGenerator.Generators[0].Filename, 0);
            var syntaxDrawer = new SyntaxDrawer(syntaxViewModel);

            GeneratorDrawers.Add(syntaxDrawer);
        }

    }
Пример #3
0
 public LineViewModel(SyntaxViewModel syntaxViewModel)
 {
     _syntaxViewModel = syntaxViewModel;
 }