示例#1
0
        private void StatusBarSelectDatabase_DoubleClick(object sender, EventArgs e)
        {
            UltraStatusPanel panel = _view.StatusStripSelectDatabase.Panels[0];
            var ex = panel.Tag as Exception;

            DialogHelper.Instance.ShowExceptionDialog(ex);
        }
示例#2
0
        /// <summary>
        /// Initializes a new <see cref="StatusPanelOwnerUIAdapter"/>
        /// </summary>
        /// <param name="panel">Panel whose owning collection will be updated with any added elements.</param>
        public StatusPanelOwnerUIAdapter(UltraStatusPanel panel)
            : base(panel.UltraStatusBar.Panels)
        {
            Guard.ArgumentNotNull(panel, "panel");

            this.panel = panel;
        }
示例#3
0
        private UltraStatusPanel getParentPanel(object sender)
        {
            var item             = (ToolStripMenuItem)sender;
            var menu             = (ContextMenuStrip)item.Owner;
            var bar              = (UltraStatusBar)menu.SourceControl;
            UltraStatusPanel lbl = bar.Panels[0];

            return(lbl);
        }
示例#4
0
        private void googleItToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UltraStatusPanel panel = getParentPanel(sender);
            var ex = panel.Tag as Exception;

            if (ex != null)
            {
                //                var ex = (Exception)panel.Tag;
                Process.Start(string.Format("http://www.google.com/search?q=%22{0}%22", ex.Message));
            }
        }
示例#5
0
        private void showEntireExceptionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UltraStatusPanel panel = getParentPanel(sender);
            var ex = panel.Tag as Exception;

            //            if (panel.Tag != null)
            //          {
            DialogHelper.Instance.ShowExceptionDialog(ex);
            //                MessageBox.Show(panel.Tag.ToString(), DialogHelper.Instance.GetApplicationName());
            //        }
        }
示例#6
0
 /// <summary>
 /// Returns the index at which an item will be added.
 /// </summary>
 /// <param name="panel">Panel to evaluate</param>
 /// <returns>By default, panels are added at the end of the associated <see cref="Panels"/> collection.</returns>
 protected override int GetNewElementIndex(UltraStatusPanel panel)
 {
     return(this.Panels.IndexOf(this.panel) + 1);
 }
 public PanelInvokerKey(UltraStatusPanel panel)
 {
     this.panel = panel;
 }
示例#8
0
文件: MainForm.cs 项目: x893/OBDwiz
        private void InitializeComponent()
        {
            m_container = (IContainer)new Container();
            Infragistics.Win.Appearance appearance = new Infragistics.Win.Appearance();
            UltraStatusPanel ultraStatusPanel1 = new UltraStatusPanel();
            UltraStatusPanel ultraStatusPanel2 = new UltraStatusPanel();
            UltraStatusPanel ultraStatusPanel3 = new UltraStatusPanel();
            UltraStatusPanel ultraStatusPanel4 = new UltraStatusPanel();
            UltraStatusPanel ultraStatusPanel5 = new UltraStatusPanel();
            UltraStatusPanel ultraStatusPanel6 = new UltraStatusPanel();
            UltraStatusPanel ultraStatusPanel7 = new UltraStatusPanel();
            UltraStatusPanel ultraStatusPanel8 = new UltraStatusPanel();
            this.tableLayoutPanel = new TableLayoutPanel();
            this.pagePanel = new Panel();
            this.customListView = new CustomListView();
            m_timer = new System.Windows.Forms.Timer(m_container);
            menuStrip = new MenuStrip();
            fileToolStripMenuItem = new ToolStripMenuItem();
            exitToolStripMenuItem = new ToolStripMenuItem();
            viewToolStripMenuItem = new ToolStripMenuItem();
            showStatusBarToolStripMenuItem = new ToolStripMenuItem();
            showListViewToolStripMenuItem = new ToolStripMenuItem();
            toolStripSeparator1 = new ToolStripSeparator();
            fullScreenToolStripMenuItem = new ToolStripMenuItem();
            windowToolStripMenuItem = new ToolStripMenuItem();
            setupToolStripMenuItem = new ToolStripMenuItem();
            diagnosticsToolStripMenuItem = new ToolStripMenuItem();
            monitorsToolStripMenuItem = new ToolStripMenuItem();
            dashboardToolStripMenuItem = new ToolStripMenuItem();
            logsToolStripMenuItem = new ToolStripMenuItem();
            connectionToolStripMenuItem = new ToolStripMenuItem();
            connectToolStripMenuItem = new ToolStripMenuItem();
            disconnectToolStripMenuItem = new ToolStripMenuItem();
            toolsToolStripMenuItem = new ToolStripMenuItem();
            vehicleManagerToolStripMenuItem = new ToolStripMenuItem();
            sensorCalibrationToolStripMenuItem = new ToolStripMenuItem();
            userDefinedPIDsToolStripMenuItem = new ToolStripMenuItem();
            pluginManagerToolStripMenuItem = new ToolStripMenuItem();
            toolStripSeparatorToolsMenu = new ToolStripSeparator();
            pidInspectorToolStripMenuItem = new ToolStripMenuItem();
            powerSaveSetupToolStripMenuItem = new ToolStripMenuItem();
            toolStripSeparatorToolsMenu2 = new ToolStripSeparator();
            preferencesToolStripMenuItem = new ToolStripMenuItem();
            toolStripContainer = new ToolStripContainer();
            m_statusPortECU = new UltraStatusBar();
            tableLayoutPanel.SuspendLayout();
            menuStrip.SuspendLayout();
            toolStripContainer.ContentPanel.SuspendLayout();
            toolStripContainer.TopToolStripPanel.SuspendLayout();

            this.toolStripContainer.SuspendLayout();
            ((ISupportInitialize)this.m_statusPortECU).BeginInit();
            this.SuspendLayout();

            this.tableLayoutPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
            this.tableLayoutPanel.ColumnCount = 2;
            this.tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 84f));
            tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f));
            tableLayoutPanel.Controls.Add(pagePanel, 1, 0);
            tableLayoutPanel.Controls.Add(customListView, 0, 0);
            tableLayoutPanel.Dock = DockStyle.Fill;
            tableLayoutPanel.Location = new Point(0, 0);
            tableLayoutPanel.Margin = new Padding(2);
            tableLayoutPanel.Name = "tableLayoutPanel";
            tableLayoutPanel.RowCount = 1;
            tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100f));
            tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 434f));
            tableLayoutPanel.Size = new Size(763, 435);
            tableLayoutPanel.TabIndex = 1;

            pagePanel.Dock = DockStyle.Fill;
            pagePanel.Location = new Point(86, 1);
            pagePanel.Margin = new Padding(0);
            pagePanel.Name = "pagePanel";
            pagePanel.Size = new Size(676, 433);
            pagePanel.TabIndex = 2;

            customListView.Dock = DockStyle.Fill;
            customListView.ItemSpacing = ListViewItemSpacing.f00009d;
            customListView.Location = new Point(3, 3);
            customListView.Margin = new Padding(2);
            customListView.Name = "customListView";
            customListView.Size = new Size(80, 429);
            customListView.TabIndex = 3;

            m_timer.Enabled = true;
            m_timer.Interval = 1000;
            m_timer.Tick += new EventHandler(m_timer_Tick);

            menuStrip.Dock = DockStyle.None;
            menuStrip.Items.AddRange(new ToolStripItem[]
            {
                fileToolStripMenuItem,
                viewToolStripMenuItem,
                windowToolStripMenuItem,
                connectionToolStripMenuItem,
                toolsToolStripMenuItem
            });
            menuStrip.Location = new Point(0, 0);
            menuStrip.Name = "menuStrip";
            menuStrip.Size = new Size(763, 24);
            menuStrip.TabIndex = 0;
            fileToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[1]
            {
                exitToolStripMenuItem
            });
            fileToolStripMenuItem.Name = "fileToolStripMenuItem";
            fileToolStripMenuItem.Size = new Size(37, 20);
            fileToolStripMenuItem.Text = "&File";
            exitToolStripMenuItem.Image = OCTech.OBD2.Applications.Properties.Resources.p000031;
            exitToolStripMenuItem.Name = "exitToolStripMenuItem";
            exitToolStripMenuItem.Size = new Size(92, 22);
            exitToolStripMenuItem.Text = "E&xit";
            exitToolStripMenuItem.Click += new EventHandler(exitToolStripMenuItem_Click);

            viewToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[]
            {
                showStatusBarToolStripMenuItem,
                showListViewToolStripMenuItem,
                toolStripSeparator1,
                fullScreenToolStripMenuItem
            });
            viewToolStripMenuItem.Name = "viewToolStripMenuItem";
            viewToolStripMenuItem.Size = new Size(44, 20);
            viewToolStripMenuItem.Text = "&View";
            viewToolStripMenuItem.DropDownOpening += new EventHandler(viewToolStripMenuItem_DropDownOpening);

            showStatusBarToolStripMenuItem.Name = "showStatusBarToolStripMenuItem";
            showStatusBarToolStripMenuItem.Size = new Size(131, 22);
            showStatusBarToolStripMenuItem.Text = "&Status Bar";
            showStatusBarToolStripMenuItem.Click += new EventHandler(showStatusBarToolStripMenuItem_Click);

            showListViewToolStripMenuItem.Name = "showListViewToolStripMenuItem";
            showListViewToolStripMenuItem.Size = new Size(131, 22);
            showListViewToolStripMenuItem.Text = "&List View";
            showListViewToolStripMenuItem.Click += new EventHandler(showListViewToolStripMenuItem_Click);

            toolStripSeparator1.Name = "toolStripSeparator1";
            toolStripSeparator1.Size = new Size(128, 6);

            fullScreenToolStripMenuItem.Name = "fullScreenToolStripMenuItem";
            fullScreenToolStripMenuItem.Size = new Size(131, 22);
            fullScreenToolStripMenuItem.Text = "&Full Screen";
            fullScreenToolStripMenuItem.Click += new EventHandler(fullScreenToolStripMenuItem_Click);

            windowToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[5]
            {
                setupToolStripMenuItem,
                diagnosticsToolStripMenuItem,
                monitorsToolStripMenuItem,
                dashboardToolStripMenuItem,
                logsToolStripMenuItem
            });
            windowToolStripMenuItem.Name = "windowToolStripMenuItem";
            windowToolStripMenuItem.Size = new Size(63, 20);
            windowToolStripMenuItem.Text = "&Window";

            setupToolStripMenuItem.Image = (Image)OCTech.OBD2.Applications.Properties.Resources.p000074;
            setupToolStripMenuItem.Name = "setupToolStripMenuItem";
            setupToolStripMenuItem.Size = new Size(135, 22);
            setupToolStripMenuItem.Text = "&Setup";
            setupToolStripMenuItem.Click += new EventHandler(setupToolStripMenuItem_Click);

            diagnosticsToolStripMenuItem.Image = (Image)OCTech.OBD2.Applications.Properties.Resources.p000025;
            diagnosticsToolStripMenuItem.Name = "diagnosticsToolStripMenuItem";
            diagnosticsToolStripMenuItem.Size = new Size(135, 22);
            diagnosticsToolStripMenuItem.Text = "&Diagnostics";
            diagnosticsToolStripMenuItem.Click += new EventHandler(diagnosticsToolStripMenuItem_Click);

            monitorsToolStripMenuItem.Image = (Image)OCTech.OBD2.Applications.Properties.Resources.p000044;
            monitorsToolStripMenuItem.Name = "monitorsToolStripMenuItem";
            monitorsToolStripMenuItem.Size = new Size(135, 22);
            monitorsToolStripMenuItem.Text = "&Monitors";
            monitorsToolStripMenuItem.Click += new EventHandler(monitorsToolStripMenuItem_Click);

            dashboardToolStripMenuItem.Image = (Image)OCTech.OBD2.Applications.Properties.Resources.p000014;
            dashboardToolStripMenuItem.Name = "dashboardToolStripMenuItem";
            dashboardToolStripMenuItem.Size = new Size(135, 22);
            dashboardToolStripMenuItem.Text = "&D&ashboard";
            dashboardToolStripMenuItem.Click += new EventHandler(dashboardToolStripMenuItem_Click);

            logsToolStripMenuItem.Image = (Image)OCTech.OBD2.Applications.Properties.Resources.p000042;
            logsToolStripMenuItem.Name = "logsToolStripMenuItem";
            logsToolStripMenuItem.Size = new Size(135, 22);
            logsToolStripMenuItem.Text = "&Logs";
            logsToolStripMenuItem.Click += new EventHandler(logsToolStripMenuItem_Click);

            connectionToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[2]
            {
                connectToolStripMenuItem,
                disconnectToolStripMenuItem
            });
            connectionToolStripMenuItem.Name = "connectionToolStripMenuItem";
            connectionToolStripMenuItem.Size = new Size(81, 20);
            connectionToolStripMenuItem.Text = "&Connection";

            connectToolStripMenuItem.Image = (Image)OCTech.OBD2.Applications.Properties.Resources.p00000e;
            connectToolStripMenuItem.Name = "connectToolStripMenuItem";
            connectToolStripMenuItem.Size = new Size(133, 22);
            connectToolStripMenuItem.Text = "&Connect";
            connectToolStripMenuItem.Click += new EventHandler(connectToolStripMenuItem_Click);

            disconnectToolStripMenuItem.Image = (Image)OCTech.OBD2.Applications.Properties.Resources.p000027;
            disconnectToolStripMenuItem.Name = "disconnectToolStripMenuItem";
            disconnectToolStripMenuItem.Size = new Size(133, 22);
            disconnectToolStripMenuItem.Text = "&Disconnect";
            disconnectToolStripMenuItem.Click += new EventHandler(disconnectToolStripMenuItem_Click);

            toolsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[9]
            {
                vehicleManagerToolStripMenuItem,
                sensorCalibrationToolStripMenuItem,
                userDefinedPIDsToolStripMenuItem,
                pluginManagerToolStripMenuItem,
                toolStripSeparatorToolsMenu,
                pidInspectorToolStripMenuItem,
                powerSaveSetupToolStripMenuItem,
                toolStripSeparatorToolsMenu2,
                preferencesToolStripMenuItem
            });
            toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
            toolsToolStripMenuItem.Size = new Size(48, 20);
            toolsToolStripMenuItem.Text = "&Tools";

            vehicleManagerToolStripMenuItem.Name = "vehicleManagerToolStripMenuItem";
            vehicleManagerToolStripMenuItem.Size = new Size(179, 22);
            vehicleManagerToolStripMenuItem.Text = "Vehicle &Manager";
            vehicleManagerToolStripMenuItem.Click += new EventHandler(vehicleManagerToolStripMenuItem_Click);

            sensorCalibrationToolStripMenuItem.Name = "sensorCalibrationToolStripMenuItem";
            sensorCalibrationToolStripMenuItem.Size = new Size(179, 22);
            sensorCalibrationToolStripMenuItem.Text = "Sensor &Calibration";
            sensorCalibrationToolStripMenuItem.Click += new EventHandler(sensorCalibrationToolStripMenuItem_Click);

            userDefinedPIDsToolStripMenuItem.Name = "userDefinedPIDsToolStripMenuItem";
            userDefinedPIDsToolStripMenuItem.Size = new Size(179, 22);
            userDefinedPIDsToolStripMenuItem.Text = "&User-Defined PIDs";
            userDefinedPIDsToolStripMenuItem.Click += new EventHandler(userDefinedPIDsToolStripMenuItem_Click);

            pluginManagerToolStripMenuItem.Image = OCTech.OBD2.Applications.Properties.Resources.p00005a;
            pluginManagerToolStripMenuItem.Name = "pluginManagerToolStripMenuItem";
            pluginManagerToolStripMenuItem.Size = new Size(179, 22);
            pluginManagerToolStripMenuItem.Text = "Plugin Manager";
            pluginManagerToolStripMenuItem.Click += new EventHandler(pluginManagerToolStripMenuItem_Click);

            toolStripSeparatorToolsMenu.Name = "toolStripSeparatorToolsMenu";
            toolStripSeparatorToolsMenu.Size = new Size(176, 6);

            pidInspectorToolStripMenuItem.Enabled = false;
            pidInspectorToolStripMenuItem.Image = OCTech.OBD2.Applications.Properties.Resources.p000057;
            pidInspectorToolStripMenuItem.Name = "pidInspectorToolStripMenuItem";
            pidInspectorToolStripMenuItem.Size = new Size(179, 22);
            pidInspectorToolStripMenuItem.Text = "PID Inspector";
            pidInspectorToolStripMenuItem.Click += new EventHandler(pidInspectorToolStripMenuItem_Click);

            powerSaveSetupToolStripMenuItem.Enabled = false;
            powerSaveSetupToolStripMenuItem.Image = OCTech.OBD2.Applications.Properties.Resources.PowerSave16x16;
            powerSaveSetupToolStripMenuItem.Name = "powerSaveSetupToolStripMenuItem";
            powerSaveSetupToolStripMenuItem.Size = new Size(179, 22);
            powerSaveSetupToolStripMenuItem.Text = "Power Save Settings";
            powerSaveSetupToolStripMenuItem.Click += new EventHandler(powerSaveSetupToolStripMenuItem_Click);

            toolStripSeparatorToolsMenu2.Name = "toolStripSeparatorToolsMenu2";
            toolStripSeparatorToolsMenu2.Size = new Size(176, 6);

            preferencesToolStripMenuItem.Image = OCTech.OBD2.Applications.Properties.Resources.p00005d;
            preferencesToolStripMenuItem.Name = "preferencesToolStripMenuItem";
            preferencesToolStripMenuItem.Size = new Size(179, 22);
            preferencesToolStripMenuItem.Text = "&Preferences";
            preferencesToolStripMenuItem.Click += new EventHandler(preferencesToolStripMenuItem_Click);

            toolStripContainer.ContentPanel.Controls.Add(tableLayoutPanel);
            toolStripContainer.ContentPanel.Padding = new Padding(0, 0, 0, 23);
            toolStripContainer.ContentPanel.Size = new Size(763, 458);
            toolStripContainer.Dock = DockStyle.Fill;
            toolStripContainer.Location = new Point(0, 0);
            toolStripContainer.Name = "toolStripContainer";
            toolStripContainer.Size = new Size(763, 482);
            toolStripContainer.TabIndex = 0;
            toolStripContainer.TopToolStripPanel.Controls.Add(menuStrip);

            m_statusPortECU.Location = new Point(0, 459);
            m_statusPortECU.Name = "ultraStatusBar";
            appearance.TextHAlignAsString = "Center";
            m_statusPortECU.PanelAppearance = appearance;

            ultraStatusPanel1.Key = "InterfacePanel";
            ultraStatusPanel1.SizingMode = PanelSizingMode.Automatic;
            ultraStatusPanel1.Style = PanelStyle.ControlContainer;
            ultraStatusPanel1.Width = 90;

            ultraStatusPanel2.Key = "ECUPanel";
            ultraStatusPanel2.SizingMode = PanelSizingMode.Automatic;
            ultraStatusPanel2.Style = PanelStyle.ControlContainer;
            ultraStatusPanel2.Width = 75;

            ultraStatusPanel3.Key = "CurrentOperationPanel";
            ultraStatusPanel3.SizingMode = PanelSizingMode.Automatic;
            ultraStatusPanel3.Visible = false;
            ultraStatusPanel3.Width = 90;

            ultraStatusPanel4.Key = "ErrorPanel";
            ultraStatusPanel4.SizingMode = PanelSizingMode.Spring;

            ultraStatusPanel5.Key = "CalPanel";
            ultraStatusPanel5.SizingMode = PanelSizingMode.Automatic;
            ultraStatusPanel5.Visible = false;

            ultraStatusPanel6.Key = "PlaybackTimePanel";
            ultraStatusPanel6.SizingMode = PanelSizingMode.Automatic;
            ultraStatusPanel6.Visible = false;

            ultraStatusPanel7.Key = "PIDTimingPanel";
            ultraStatusPanel7.Width = 85;

            ultraStatusPanel8.Key = "ClockPanel";
            ultraStatusPanel8.SizingMode = PanelSizingMode.Automatic;
            ultraStatusPanel8.Style = PanelStyle.Time;

            m_statusPortECU.Panels.AddRange(new UltraStatusPanel[]
            {
                ultraStatusPanel1,
                ultraStatusPanel2,
                ultraStatusPanel3,
                ultraStatusPanel4,
                ultraStatusPanel5,
                ultraStatusPanel6,
                ultraStatusPanel7,
                ultraStatusPanel8
            });

            m_statusPortECU.Size = new Size(763, 23);
            m_statusPortECU.SizeGripVisible = DefaultableBoolean.False;
            m_statusPortECU.TabIndex = 1;
            m_statusPortECU.ViewStyle = ViewStyle.VisualStudio2005;
            this.AutoScaleDimensions = new SizeF(6f, 13f);
            AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new Size(763, 482);
            this.Controls.Add(m_statusPortECU);
            this.Controls.Add(toolStripContainer);
            this.MainMenuStrip = menuStrip;
            this.Margin = new Padding(2);
            this.Name= "MainForm";
            StartPosition = FormStartPosition.CenterScreen;
            this.WindowState = FormWindowState.Maximized;
            tableLayoutPanel.ResumeLayout(false);
            menuStrip.ResumeLayout(false);
            menuStrip.PerformLayout();
            toolStripContainer.ContentPanel.ResumeLayout(false);
            toolStripContainer.TopToolStripPanel.ResumeLayout(false);
            toolStripContainer.TopToolStripPanel.PerformLayout();
            toolStripContainer.ResumeLayout(false);
            toolStripContainer.PerformLayout();
            ((ISupportInitialize)m_statusPortECU).EndInit();
            this.ResumeLayout(false);
        }