コード例 #1
0
    private DemoApp(string[] args, params object[] props) : base("ObjectBrowserDemo", version, Modules.UI, args, props)
    {
        gXML = new Glade.XML(null, "demoapp.glade", "DemoApp", null);
        gXML.Autoconnect(this);

        browser   = new ObjectBrowser();
        this.args = args;

        window = (App)gXML.GetWidget("DemoApp");
        Load();

        ((MenuItem)gXML.GetWidget("HelpMenu")).RightJustified = true;

        window.Contents = browser;
        window.ShowAll();
        browser.AppBar = (AppBar)gXML.GetWidget("AppBar");;
    }
コード例 #2
0
        public ComponentInspectorView()
        {
            instance = this;

            SetLocalizedTitle("${res:ComponentInspector.ToolsMenu.ShowComponentInspectorMenuItem}");

            // HACK: Due to various static members in the ComponentInspector
            // the ObjectBrowser does not like being re-used after being disposed.
            // Workaround this by keeping a reference to the ObjectBrowser.
            if (objectBrowser == null)
            {
                objectBrowser = new ObjectBrowser(showStatusPanel, tabbedLayout);
            }
            AssemblySupport.AddCurrentAssemblies();
            ComSupport.RestoreComEnvironment();
            AssemblySupport.RestoreAssemblies();
            Application.Idle += IdleHandler;
        }
コード例 #3
0
        private static void AssertNodes(ObjectBrowser objectBrowser, params NodeInfo[] expectedNodes)
        {
            int nodeCount = objectBrowser.TypeBrowserPane.Nodes.Count;

            Assert.AreEqual(expectedNodes.Length, nodeCount, "Node count: " + nodeCount.ToString());

            for (int i = 0; i < expectedNodes.Length; ++i)
            {
                // Check node name
                string str = objectBrowser.TypeBrowserPane.Nodes[i].Value.Trim();
                Assert.AreEqual(expectedNodes[i].Name, str, "");

                objectBrowser.TypeBrowserPane.Nodes[i].Select();
                System.Threading.Thread.Sleep(1000);

                // Check detailed node description.
                str = objectBrowser.DetailPane.Value.Trim();
                Assert.AreEqual(expectedNodes[i].Description, str, "");

                // Check dependent nodes in member pane
                nodeCount = objectBrowser.TypeNavigatorPane.Nodes.Count;
                var expectedMembers = expectedNodes[i].Members;
                if (expectedMembers == null)
                {
                    Assert.AreEqual(0, nodeCount, "Node Count: " + nodeCount.ToString());
                }
                else
                {
                    Assert.AreEqual(expectedMembers.Count, nodeCount, "Node Count: " + nodeCount.ToString());
                    for (int j = 0; j < expectedMembers.Count; ++j)
                    {
                        str = objectBrowser.TypeNavigatorPane.Nodes[j].Value.Trim();
                        Assert.AreEqual(expectedMembers[j], str, "");
                    }
                }
            }
        }
コード例 #4
0
 private static void AssertNodes(ObjectBrowser objectBrowser, params NodeInfo[] expectedNodes)
 {
     AssertNodes(objectBrowser, true, expectedNodes);
 }
コード例 #5
0
ファイル: ObjectBrowser.cs プロジェクト: viaa/ObjectBrowser
 static void Main(string[] args)
 {
     ObjectBrowser ob = null;
     try {
         //ob = new ObjectBrowser(args);
         ob = new ObjectBrowser();
         //ob.Browse();
         ob.Index();
         //Console.WriteLine(ob.Info.ToString());
     }
     catch (Exception e) {
         Console.WriteLine(string.Format("{0} {1}", e.Message, ob.ObjectName));
     }
 }
コード例 #6
0
ファイル: DemoApp.cs プロジェクト: emtees/old-code
	private DemoApp (string[] args, params object[] props) : base ("ObjectBrowserDemo", version, Modules.UI, args, props)
	{
		gXML = new Glade.XML (null, "demoapp.glade", "DemoApp", null);
		gXML.Autoconnect (this);
		
		browser = new ObjectBrowser ();
		this.args = args;

		window = (App) gXML.GetWidget ("DemoApp");
		Load ();

		((MenuItem) gXML.GetWidget ("HelpMenu")).RightJustified = true;

		window.Contents = browser;
		window.ShowAll ();
		browser.AppBar = (AppBar) gXML.GetWidget ("AppBar");;
	}
コード例 #7
0
        public async void CreateWindows()
        {
            const int margin     = 5;
            const int leftOffset = 150;
            const int topOffset  = 150;

            var isInEditMode = _dataProvider.CommonSettings.AppMode == AppMode.Editor;

            var mainViewModel = new MainViewModel(_dataProvider);

            _mainWindow = new MainWindow(mainViewModel);

            var objectBrowserViewModel = new ObjectBrowserViewModel(_dataProvider);

            _objectBrowser = new ObjectBrowser(objectBrowserViewModel)
            {
                Height = _mainWindow.Height
            };

            var toolsPanelViewModel = new ToolsPanelViewModel(_dataProvider);

            _toolsPanel = new ToolsPanel(toolsPanelViewModel);

            var variablesViewerViewModel = new VariablesViewerViewModel(_dataProvider);

            _variablesViewer = new VariablesViewer(variablesViewerViewModel);

            if (_dataProvider.CommonSettings.ObjectBrowserSettings.IsSet)
            {
                _objectBrowser.Left = _dataProvider.CommonSettings.ObjectBrowserSettings.Left;
                _objectBrowser.Top  = _dataProvider.CommonSettings.ObjectBrowserSettings.Top;
            }
            else
            {
                _objectBrowser.Left = leftOffset;
                _objectBrowser.Top  = topOffset + _toolsPanel.Height + margin;
            }

            _toolsPanel.Width = _objectBrowser.Width + _mainWindow.Width + margin;
            if (_dataProvider.CommonSettings.ToolsPanelSettings.IsSet)
            {
                _toolsPanel.Left = _dataProvider.CommonSettings.ToolsPanelSettings.Left;
                _toolsPanel.Top  = _dataProvider.CommonSettings.ToolsPanelSettings.Top;
            }
            else
            {
                _toolsPanel.Left = leftOffset;
                _toolsPanel.Top  = topOffset;
            }

            _variablesViewer.Height = _toolsPanel.Height + _mainWindow.Height + margin;
            if (_dataProvider.CommonSettings.VariablesViewerSettings.IsSet)
            {
                _variablesViewer.Left = _dataProvider.CommonSettings.VariablesViewerSettings.Left;
                _variablesViewer.Top  = _dataProvider.CommonSettings.VariablesViewerSettings.Top;
            }
            else
            {
                _variablesViewer.Left = _mainWindow.Left + _mainWindow.Width + margin;
                _variablesViewer.Top  = _toolsPanel.Top;
            }

            if (_dataProvider.CommonSettings.MainWindowSettings.IsSet)
            {
                _mainWindow.Left = _dataProvider.CommonSettings.MainWindowSettings.Left;
                _mainWindow.Top  = _dataProvider.CommonSettings.MainWindowSettings.Top;
            }
            else
            {
                _mainWindow.Left = leftOffset + _objectBrowser.Width + margin;
                _mainWindow.Top  = topOffset + _toolsPanel.Height + margin;
            }

            Application.Current.MainWindow = _mainWindow;
            _mainWindow.Activated         += GotFocus;
            _mainWindow.Closing           += OnClose;
            _mainWindow.StateChanged      += OnStateChanged;


            _toolsPanel.Closing += (sender, e) =>
            {
                e.Cancel = true;
                HideToolsPanel();
            };
            _objectBrowser.Closing += (sender, e) =>
            {
                e.Cancel = true;
                HideObjectBrowser();
            };
            _variablesViewer.Closing += (sender, e) =>
            {
                e.Cancel = true;
                HideVariablesViewer();
            };

            _toolsPanel.Hide();
            _variablesViewer.Hide();
            _objectBrowser.Hide();
            CenterMainWindow();

            _mainWindow.Show();
            SetVisibility();

            if (!_dataProvider.CommonSettings.IsSet)
            {
                await _dataProvider.DialogsManager.OpenConfiguration(_dataProvider);
            }
            else if (!isInEditMode)
            {
                await _dataProvider.DialogsManager.ShowMenu();
            }
        }