/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmCsinfo_Load(object sender, System.EventArgs e) { Text = _info.Address; LogItem li = new LogItem(); li.HasDateTime = false; li.Add("名称 ", _info.Address); li.Add("通讯地址", _info.DeviceAddress); li.Add("IP地址 ", _info.IP.ToString()); li.Add("设备类型", _info.DeviceKind); li.Add("电话号码", _info.Sim); if (_info.DeviceKind == DeviceInfoManager.TEXT_PUMP) { li.Add("泵站协议", _info.PumpCommunicationProtocolVersion); } li.Add(string.Empty); for (int i = 0; i < _info.Tally.Count; i++) { TallyItem ti = _info.Tally[i]; li.Add(ti.Name, ti.List.Count); cmbListName.Items.Add(ti.Name); } if (cmbListName.Items.Count > 0) { cmbListName.SelectedIndex = 0; } this.txtDetail.Text = li.ToString(); }
/// <summary> /// /// </summary> /// <param name="name"></param> /// <param name="data"></param> public void Add( string name, object data ) { bool isFind = false; foreach ( object obj in _itemList ) { TallyItem ti = obj as TallyItem; if ( string.Compare( ti.Name, name, true ) == 0 ) { isFind = true; if ( ti.List.Count >= MAXCOUNT ) ti.List.Clear(); ti.List.Add( data ); break; } } if ( !isFind ) { TallyItem ti = new TallyItem( name ); ti.List.Add( data ); _itemList.Add( ti ); } }
/// <summary> /// /// </summary> /// <param name="name"></param> /// <param name="data"></param> public void Add(string name, object data) { bool isFind = false; foreach (object obj in _itemList) { TallyItem ti = obj as TallyItem; if (string.Compare(ti.Name, name, true) == 0) { isFind = true; if (ti.List.Count >= MAXCOUNT) { ti.List.Clear(); } ti.List.Add(data); break; } } if (!isFind) { TallyItem ti = new TallyItem(name); ti.List.Add(data); _itemList.Add(ti); } }
/// <summary> /// /// </summary> public void Clear() { foreach (object obj in _itemList) { TallyItem ti = obj as TallyItem; ti.List.Clear(); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDetail_Click(object sender, System.EventArgs e) { string text = cmbListName.Text; if (text != string.Empty) { TallyItem ti = GetTallyItem(text); if (ti != null) { new frmTallyDetail(ti).ShowDialog(this); } } }
public frmTallyDetail( TallyItem ti ) { // // Windows ���������֧��������� // InitializeComponent(); // // TODO: �� InitializeComponent ���ú�����κι��캯������ // if ( ti == null ) throw new ArgumentNullException( "ti" ); _tallyItem = ti; }
public frmTallyDetail(TallyItem ti) { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // if (ti == null) { throw new ArgumentNullException("ti"); } _tallyItem = ti; }
/// <summary> /// /// </summary> /// <param name="name"></param> public void AddTallyItem( string name ) { TallyItem item = new TallyItem( name ); _itemList.Add( item ); }
/// <summary> /// /// </summary> /// <param name="name"></param> public void AddTallyItem(string name) { TallyItem item = new TallyItem(name); _itemList.Add(item); }