Example #1
0
        void Refresh()
        {
            List <string> entries = new List <string>();

            if (DataContext is KeyValuePair <string, IOItem> )
            {
                KeyValuePair <string, IOItem> keyValuePair = (KeyValuePair <string, IOItem>)DataContext;
                IOItem currentItem = keyValuePair.Value;

                var infoControl = TemplatedParent.GetParent <NodeInfoContainer>(null);
                var control     = infoControl != null ? infoControl.OriginElement : null;
                if (control != null)
                {
                    // We'll need to query the canvas for links
                    //NodeGraphLayout canvas = control.RootCanvas as NodeGraphLayout;
                    TraceLab.UI.WPF.Views.DockableGraph topGraph = control.GetParent <TraceLab.UI.WPF.Views.DockableGraph>(null);
                    NodeGraphLayout canvas = topGraph.graphLayout;

                    // Add the current mapping
                    entries.Add(currentItem.MappedTo);

                    // Get the current item's type so that we can limit the selection to only this type
                    string currentType = currentItem.IOItemDefinition.Type;

                    var availableInputMappingsPerNode = new TraceLab.Core.Utilities.InputMappings(canvas.Graph);

                    ExperimentNode currentNode = control.Vertex as ExperimentNode;

                    //if currentNode is a ExperimentNode, and is ioValidator has incoming outputs for this node (otherwise, it has not been connected to start node)
                    if (currentNode != null && availableInputMappingsPerNode.ContainsMappingsForNode(currentNode))
                    {
                        foreach (string incomingOutput in availableInputMappingsPerNode[currentNode].Keys)
                        {
                            if (string.Equals(currentType, availableInputMappingsPerNode[currentNode][incomingOutput]))
                            {
                                entries.Add(incomingOutput);
                            }
                        }
                    }
                }
            }
            this.ItemsSource = entries.Distinct();
        }
Example #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ReadOnlyGraphRoot = ((TraceLab.UI.WPF.Views.ReadonlyDockableGraph)(target));
                return;

            case 2:

            #line 42 "..\..\..\Views\ReadonlyDockableGraph.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.ExecuteToggleLogLevel);

            #line default
            #line hidden

            #line 43 "..\..\..\Views\ReadonlyDockableGraph.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CanToggleLogLevel);

            #line default
            #line hidden
                return;

            case 3:
                this.zoomControl = ((TraceLab.UI.WPF.Controls.ZoomControl.ZoomControl)(target));
                return;

            case 4:
                this.MarqueeAdorner = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 5:
                this.graphLayout = ((TraceLab.UI.WPF.Controls.NodeGraphLayout)(target));
                return;
            }
            this._contentLoaded = true;
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.ReadOnlyGraphRoot = ((TraceLab.UI.WPF.Views.ReadonlyDockableGraph)(target));
     return;
     case 2:
     
     #line 42 "..\..\..\Views\ReadonlyDockableGraph.xaml"
     ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.ExecuteToggleLogLevel);
     
     #line default
     #line hidden
     
     #line 43 "..\..\..\Views\ReadonlyDockableGraph.xaml"
     ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CanToggleLogLevel);
     
     #line default
     #line hidden
     return;
     case 3:
     this.zoomControl = ((TraceLab.UI.WPF.Controls.ZoomControl.ZoomControl)(target));
     return;
     case 4:
     this.MarqueeAdorner = ((System.Windows.Shapes.Rectangle)(target));
     return;
     case 5:
     this.graphLayout = ((TraceLab.UI.WPF.Controls.NodeGraphLayout)(target));
     return;
     }
     this._contentLoaded = true;
 }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     
     #line 40 "..\..\..\Views\ScopeGraph.xaml"
     ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.ExecuteRemoveNode);
     
     #line default
     #line hidden
     
     #line 41 "..\..\..\Views\ScopeGraph.xaml"
     ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CanExecuteRemoveNode);
     
     #line default
     #line hidden
     return;
     case 2:
     
     #line 43 "..\..\..\Views\ScopeGraph.xaml"
     ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.ExecuteRemoveSelectedNodes);
     
     #line default
     #line hidden
     
     #line 44 "..\..\..\Views\ScopeGraph.xaml"
     ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CanExecuteRemoveSelectedNodes);
     
     #line default
     #line hidden
     return;
     case 3:
     
     #line 46 "..\..\..\Views\ScopeGraph.xaml"
     ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.ExecuteToggleLogLevel);
     
     #line default
     #line hidden
     
     #line 47 "..\..\..\Views\ScopeGraph.xaml"
     ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CanToggleLogLevel);
     
     #line default
     #line hidden
     return;
     case 4:
     
     #line 49 "..\..\..\Views\ScopeGraph.xaml"
     ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.ExecuteCreateConnection);
     
     #line default
     #line hidden
     return;
     case 5:
     
     #line 51 "..\..\..\Views\ScopeGraph.xaml"
     ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.ExecuteAddScopeToDecision);
     
     #line default
     #line hidden
     return;
     case 6:
     
     #line 54 "..\..\..\Views\ScopeGraph.xaml"
     ((System.Windows.Controls.DockPanel)(target)).PreviewDrop += new System.Windows.DragEventHandler(this.Graph_Drop);
     
     #line default
     #line hidden
     
     #line 55 "..\..\..\Views\ScopeGraph.xaml"
     ((System.Windows.Controls.DockPanel)(target)).PreviewDragOver += new System.Windows.DragEventHandler(this.Graph_DragOver);
     
     #line default
     #line hidden
     return;
     case 7:
     this.zoomControl = ((TraceLab.UI.WPF.Controls.ZoomControl.ZoomControl)(target));
     return;
     case 8:
     this.marqueeAdorner = ((System.Windows.Shapes.Rectangle)(target));
     return;
     case 9:
     this.graphLayout = ((TraceLab.UI.WPF.Controls.NodeGraphLayout)(target));
     return;
     case 10:
     this.HACK_Vertex = ((GraphSharp.Controls.VertexControl)(target));
     return;
     case 11:
     this.HACK_Edge = ((GraphSharp.Controls.EdgeControl)(target));
     return;
     }
     this._contentLoaded = true;
 }
Example #5
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 40 "..\..\..\Views\ScopeGraph.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.ExecuteRemoveNode);

            #line default
            #line hidden

            #line 41 "..\..\..\Views\ScopeGraph.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CanExecuteRemoveNode);

            #line default
            #line hidden
                return;

            case 2:

            #line 43 "..\..\..\Views\ScopeGraph.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.ExecuteRemoveSelectedNodes);

            #line default
            #line hidden

            #line 44 "..\..\..\Views\ScopeGraph.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CanExecuteRemoveSelectedNodes);

            #line default
            #line hidden
                return;

            case 3:

            #line 46 "..\..\..\Views\ScopeGraph.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.ExecuteToggleLogLevel);

            #line default
            #line hidden

            #line 47 "..\..\..\Views\ScopeGraph.xaml"
                ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CanToggleLogLevel);

            #line default
            #line hidden
                return;

            case 4:

            #line 49 "..\..\..\Views\ScopeGraph.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.ExecuteCreateConnection);

            #line default
            #line hidden
                return;

            case 5:

            #line 51 "..\..\..\Views\ScopeGraph.xaml"
                ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.ExecuteAddScopeToDecision);

            #line default
            #line hidden
                return;

            case 6:

            #line 54 "..\..\..\Views\ScopeGraph.xaml"
                ((System.Windows.Controls.DockPanel)(target)).PreviewDrop += new System.Windows.DragEventHandler(this.Graph_Drop);

            #line default
            #line hidden

            #line 55 "..\..\..\Views\ScopeGraph.xaml"
                ((System.Windows.Controls.DockPanel)(target)).PreviewDragOver += new System.Windows.DragEventHandler(this.Graph_DragOver);

            #line default
            #line hidden
                return;

            case 7:
                this.zoomControl = ((TraceLab.UI.WPF.Controls.ZoomControl.ZoomControl)(target));
                return;

            case 8:
                this.marqueeAdorner = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 9:
                this.graphLayout = ((TraceLab.UI.WPF.Controls.NodeGraphLayout)(target));
                return;

            case 10:
                this.HACK_Vertex = ((GraphSharp.Controls.VertexControl)(target));
                return;

            case 11:
                this.HACK_Edge = ((GraphSharp.Controls.EdgeControl)(target));
                return;
            }
            this._contentLoaded = true;
        }