public PUCFrame() { // // Required for Windows Form Designer support // InitializeComponent(); Debug.Assert(DEFAULT_FRAME == null, "PUCFrame should only be instantiated once."); PUCFrame.DEFAULT_FRAME = this; _measureCtl = new MeasureStringControl(); this.Controls.Add(_measureCtl); _measureCtl.Location = new Point(0, 0); _measureCtl.Size = new Size(0, 0); _measureCtl.Enabled = false; Globals.Init(VERSION_STRING, "\\Storage\\PUC\\pucdata.xml", this, this, this, this, _measureCtl, "\\Storage\\PUC\\smartphone.xml"); _uiEventQueue = new Queue(); _appliances = new ArrayList(); _servers = new ArrayList(); this.Text = Globals.GetVersionString(); AddLogText(Globals.GetVersionString() + " Starting..."); this.logPanel.Size = this.ClientSize; this.logBox.Size = new System.Drawing.Size(this.logPanel.Size.Width, this.logPanel.Size.Height - this.logBox.Location.Y); _connectDialog = new PhoneConnectDlg(this); _optionsDialog = new PhoneOptionsDlg(); _leftMenuStack = new Stack(); LeftMenuStackItem item = new LeftMenuStackItem("Open", new EventHandler(this.openItem_Click)); this.PushLeftMenuStack(item); _mutex = new Mutex(); SetupRecentList(); SetupRulePhases(); _registry = WidgetRegistryParser.Parse(Globals.GetWidgetRegistryFileName()); SetupSmartCIOManager(); AddLogLine("Done."); }
private void actionItem_Click(object sender, System.EventArgs e) { Stack stack = null; if (logPanel.Visible == true || _currentAppliance == null) { stack = _leftMenuStack; } else { stack = _currentAppliance.LeftMenuStack; } LeftMenuStackItem currentItem = (LeftMenuStackItem)stack.Peek(); currentItem.Handler(sender, e); }
protected void setActionItemName() { Stack stack = null; if (logPanel.Visible == true || _currentAppliance == null) { stack = _leftMenuStack; } else { stack = _currentAppliance.LeftMenuStack; } LeftMenuStackItem currentItem = (LeftMenuStackItem)stack.Peek(); actionItem.Text = currentItem.Name; }
public void PopLeftMenuStack() { Stack stack = null; if (logPanel.Visible == true || _currentAppliance == null) { stack = _leftMenuStack; } else { stack = _currentAppliance.LeftMenuStack; } LeftMenuStackItem oldItem = (LeftMenuStackItem)stack.Pop(); LeftMenuStackItem newItem = (LeftMenuStackItem)stack.Peek(); actionItem.Text = newItem.Name; }
public void PushLeftMenuStack(LeftMenuStackItem newItem) { Stack stack = null; if (logPanel.Visible == true || _currentAppliance == null) { stack = _leftMenuStack; } else { stack = _currentAppliance.LeftMenuStack; } LeftMenuStackItem oldItem = null; if (stack.Count > 0) { oldItem = (LeftMenuStackItem)stack.Peek(); } actionItem.Text = newItem.Name; stack.Push(newItem); }