Esempio n. 1
0
        public void CreateMashup(GraphNode graphNode, IWorkflowEditorService editorService)
        {
            var dialogMashup     = visualizer.Value as DialogMashupVisualizer;
            var visualizerDialog = workflowGraphView.GetVisualizerDialogLauncher(graphNode);

            if (dialogMashup != null && visualizerDialog != null)
            {
                var dialogMashupType = dialogMashup.GetType();
                var visualizerType   = visualizerDialog.visualizer.Value.GetType();
                var mashupVisualizer = default(Type);
                while (dialogMashupType != null && dialogMashupType != typeof(DialogMashupVisualizer))
                {
                    var mashup = typeof(VisualizerMashup <,>).MakeGenericType(dialogMashupType, visualizerType);
                    mashupVisualizer = editorService.GetTypeVisualizers(mashup).SingleOrDefault();
                    if (mashupVisualizer != null)
                    {
                        break;
                    }
                    dialogMashupType = dialogMashupType.BaseType;
                }

                if (mashupVisualizer != null)
                {
                    UnloadMashups();
                    var visualizerMashup = (MashupTypeVisualizer)Activator.CreateInstance(mashupVisualizer);
                    dialogMashup.Mashups.Add(new VisualizerMashup(visualizerDialog.visualizerSource.Output, visualizerMashup));
                    ReloadMashups();
                }
            }
        }
Esempio n. 2
0
 void visualizerDialog_DragDrop(object sender, DragEventArgs e)
 {
     if (graphView != null && visualizerContext != null && e.Data.GetDataPresent(typeof(GraphNode)))
     {
         var graphNode         = (GraphNode)e.Data.GetData(typeof(GraphNode));
         var typeVisualizerMap = (TypeVisualizerMap)visualizerContext.GetService(typeof(TypeVisualizerMap));
         var visualizerDialog  = graphView.GetVisualizerDialogLauncher(graphNode);
         CreateMashup(visualizerDialog, typeVisualizerMap);
     }
 }
        public void CreateMashup(GraphNode graphNode, IWorkflowEditorService editorService)
        {
            var dialogMashup     = visualizer.Value as DialogMashupVisualizer;
            var visualizerDialog = workflowGraphView.GetVisualizerDialogLauncher(graphNode);

            if (dialogMashup != null && visualizerDialog != null)
            {
                var dialogMashupType = dialogMashup.GetType();
                var visualizerType   = visualizerDialog.visualizer.Value.GetType();
                var mashupVisualizer = GetMashupVisualizerType(dialogMashupType, visualizerType, editorService);
                if (mashupVisualizer != null)
                {
                    UnloadMashups();
                    var visualizerMashup = (MashupTypeVisualizer)Activator.CreateInstance(mashupVisualizer);
                    dialogMashup.Mashups.Add(new VisualizerMashup(visualizerDialog.visualizerSource.Output, visualizerMashup));
                    ReloadMashups();
                }
            }
        }