private void ProjectStartup_Load(object sender, EventArgs e) { if (Properties.Settings.Default.LastLoadedProjects.Trim() != string.Empty) { string[] splitted = Properties.Settings.Default.LastLoadedProjects.Split('|'); foreach (string split in splitted) { if (split.Trim() != string.Empty && File.Exists(split)) { KryptonListItem item = new KryptonListItem(Path.GetDirectoryName(split)); item.Tag = split; listBox.Items.Add(item); } } } }
private object CreateNewItem() { KryptonListItem item = new KryptonListItem(); item.ShortText = "Item " + (_next++).ToString(); item.LongText = "(" + _rand.Next(Int32.MaxValue).ToString() + ")"; item.Image = imageList.Images[_rand.Next(imageList.Images.Count - 1)]; return item; }
/// <summary> /// Globals the setting_ add endoscope automatic queue event. /// </summary> /// <param name="endoscope">The endoscope.</param> private void GlobalSetting_AddEndoscopeToQueueEvent(EndoscopeState endoscope) { Action action = delegate() { var ListItem = new KryptonListItem(); ListItem.Tag = endoscope.txtEndoscopeID.Text; ListItem.Image = ProxyClient.Properties.Resources.ok; ListItem.ShortText = "内镜" + endoscope.txtEndoscopeID.Text + "等待确认"; ListItem.LongText = "清洗员编号:" + endoscope.txtWasherSN.Text; if (!string.IsNullOrEmpty(endoscope.EndoscopeCleanStandarData)) { ListItem.LongText += " 清洗不合格信息:[" + endoscope.EndoscopeCleanStandarData + "]"; ListItem.Image = ProxyClient.Properties.Resources.no; } this.sureList.Items.Add(ListItem); }; // 添加队列 this.sureList.Invoke(action); }