Esempio n. 1
0
        // END HERZUM SPRINT 3: TLAB-86

        private void HandleRowActivated(object source, RowActivatedArgs args)
        {
            TreeIter item;

            if (m_treeView.Selection.GetSelected(out item))
            {
                WorkspaceUnit unit = (WorkspaceUnit)m_treeView.Model.GetValue(item, 0);

                //prepare display funtions
                //first try to display it with GTK, and eventually fallback to windows form display
                var displaysFuncs = new WorkspaceViewerLoader.DisplayEditor[]
                {
                    DisplayGTKWindow,
                    WorkspaceViewerLoader.DisplayWindowsFormEditor
                };

                String error;
                if (!WorkspaceViewerLoader.LoadViewer(unit.Data, unit.FriendlyUnitName,
                                                      WorkspaceUIAssemblyExtensions.Extensions, displaysFuncs,
                                                      out error))
                {
                    NLog.LogManager.GetCurrentClassLogger().Warn(error);
                }
            }
        }
        private void tracesList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var grid = sender as DataGrid;
            if(grid != null)
            {
                var unit = grid.SelectedItem as WpfWorkspaceUnitWrapper;
                if(unit != null && unit.Type != null && unit.Data != null)
                {
                    //also first try to display it with wpf method, and eventually fallback to windows form display
                    var displaysFuncs = new WorkspaceViewerLoader.DisplayEditor[]
                    {
                        DisplayWPFWindow,
                        WorkspaceViewerLoader.DisplayWindowsFormEditor
                    };

                    string error = String.Empty;

                    //try find first wpf specific gui, and then default gui
                    if (!WorkspaceViewerLoader.LoadViewer(unit.Data, unit.FriendlyUnitName, WorkspaceUIAssemblyExtensions.Extensions, displaysFuncs, out error))
                    {
                        NLog.LogManager.GetCurrentClassLogger().Warn(error);
                        MessageBox.Show(error);
                    }   
                }
            }
        }
Esempio n. 3
0
        private void tracesList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var grid = sender as DataGrid;

            if (grid != null)
            {
                var unit = grid.SelectedItem as WpfWorkspaceUnitWrapper;
                if (unit != null && unit.Type != null && unit.Data != null)
                {
                    //also first try to display it with wpf method, and eventually fallback to windows form display
                    var displaysFuncs = new WorkspaceViewerLoader.DisplayEditor[]
                    {
                        DisplayWPFWindow,
                        WorkspaceViewerLoader.DisplayWindowsFormEditor
                    };

                    string error = String.Empty;

                    //try find first wpf specific gui, and then default gui
                    if (!WorkspaceViewerLoader.LoadViewer(unit.Data, unit.FriendlyUnitName, WorkspaceUIAssemblyExtensions.Extensions, displaysFuncs, out error))
                    {
                        NLog.LogManager.GetCurrentClassLogger().Warn(error);
                        MessageBox.Show(error);
                    }
                }
            }
        }
Esempio n. 4
0
        // END HERZUM SPRINT 3: TLAB-86

        private void HandleRowActivated (object source, RowActivatedArgs args)
        {
            TreeIter item;
            if(m_treeView.Selection.GetSelected(out item)) 
            {
                WorkspaceUnit unit = (WorkspaceUnit)m_treeView.Model.GetValue(item, 0);

                //prepare display funtions
                //first try to display it with GTK, and eventually fallback to windows form display
                var displaysFuncs = new WorkspaceViewerLoader.DisplayEditor[]
                {
                    DisplayGTKWindow,
                    WorkspaceViewerLoader.DisplayWindowsFormEditor
                };

                String error;
                if(!WorkspaceViewerLoader.LoadViewer(unit.Data, unit.FriendlyUnitName, 
                                                     WorkspaceUIAssemblyExtensions.Extensions, displaysFuncs, 
                                                     out error))
                {
                    NLog.LogManager.GetCurrentClassLogger().Warn(error);
                }
            }
        }