Exemplo n.º 1
0
		// 加入一个新事项
		public ScriptAction NewItem(string strName,
			string strComment,
			string strScriptEntry,
			bool bActive)
		{
			ScriptAction item = new ScriptAction();
			item.Name = strName;
			item.Comment = strComment;
			item.ScriptEntry = strScriptEntry;
			item.Active = bActive;

			this.Add(item);
			return item;
		}
Exemplo n.º 2
0
        private void button_OK_Click(object sender, System.EventArgs e)
        {
            if (listView1.SelectedItems.Count == 0)
            {
                MessageBox.Show(this, "尚未选择事项...");
                return;
            }

            this.SelectedIndex = listView1.SelectedIndices[0];
            if (Actions != null)
            {
                this.SelectedAction = (ScriptAction)this.Actions[this.SelectedIndex];
            }
            else
            {
                this.SelectedAction = null;
            }


            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Exemplo n.º 3
0
        void FillList()
        {
            listView1.Items.Clear();
            if (Actions == null)
            {
                return;
            }

            for (int i = 0; i < Actions.Count; i++)
            {
                ScriptAction action = (ScriptAction)Actions[i];

                ListViewItem item = new ListViewItem(action.Name, 0);
                item.SubItems.Add(action.Comment);
                item.SubItems.Add(action.ScriptEntry);

                if (action.Active == true)
                {
                    item.Selected = true;
                }

                listView1.Items.Add(item);
            }
        }
Exemplo n.º 4
0
		private void button_OK_Click(object sender, System.EventArgs e)
		{
			if (listView1.SelectedItems.Count == 0) 
			{
				MessageBox.Show(this, "尚未选择事项...");
				return;
			}

			this.SelectedIndex = listView1.SelectedIndices[0];
			if (Actions != null)
				this.SelectedAction = (ScriptAction)this.Actions[this.SelectedIndex];
			else
				this.SelectedAction = null;

		
			this.DialogResult = DialogResult.OK;
			this.Close();
		}