public DlgSetAlarm(Share share, stAlarm a) { InitializeComponent(); mShare = share; mAlarm = a; this.Text = "Alarm: " + a.code; if (a.upperPrice == 0) { cb_Upper.Checked = false; tb_Upper.Enabled = false; } else { cb_Upper.Checked = true; tb_Upper.Text = "" + (a.upperPrice); } if (a.lowerPrice == 0) { cb_Lower.Checked = false; tb_Lower.Enabled = false; } else { cb_Lower.Checked = true; tb_Lower.Text = "" + (a.lowerPrice); } tb_comment.Text = a.comment; //================================ mContext = Context.getInstance(); mContext.setCurrentShare(a.code); if (mShare != null) { if (!mShare.loadShareFromFile(true)) { mShare.loadShareFromCommonData(true); } } //================================ lb_UpperPercent.Text = "-"; lb_LowerPercent.Text = "-"; updatePercentLabel(mAlarm.lowerPrice, lb_LowerPercent); updatePercentLabel(mAlarm.upperPrice, lb_UpperPercent); //================================ HistoryChartControl chart = new HistoryChartControl(share, "panel1", panel_Chart.Width, panel_Chart.Height, false); chart.setListener(this); mChart = chart; panel_Chart.Controls.Add(chart.getControl()); }
public AlarmItem(stAlarm alarm) : base(null) { makeCustomRender(true); mAlarm = alarm; mContext = Context.getInstance(); mAlarmImage = mContext.getImage(C.IMG_ALARM_BELL); mArrowImage = mContext.getImage(C.IMG_SMALL_ARROWS); xMainApplication.getxMainApplication().registerTick(this); }