6 changed files with 3 additions and 231 deletions
@ -1,126 +0,0 @@ |
|||||||
<Components version="1.0"> |
|
||||||
<System.Windows.Forms.UserControl> |
|
||||||
<Name value="MyUserControl" /> |
|
||||||
<DockPadding value="" /> |
|
||||||
<ClientSize value="{Width=280, Height=296}" /> |
|
||||||
<Controls> |
|
||||||
<System.Windows.Forms.GroupBox> |
|
||||||
<Name value="groupBox" /> |
|
||||||
<TabIndex value="0" /> |
|
||||||
<Location value="{X=4,Y=8}" /> |
|
||||||
<Anchor value="Top, Left, Right" /> |
|
||||||
<Size value="{Width=272, Height=188}" /> |
|
||||||
<Text value="${res:Dialog.Options.IDEOptions.TaskListOptions.CommentTagsGroupBox}" /> |
|
||||||
<Controls> |
|
||||||
<System.Windows.Forms.Button> |
|
||||||
<Name value="changeButton" /> |
|
||||||
<Location value="{X=128,Y=128}" /> |
|
||||||
<Text value="${res:Global.ChangeButtonText}" /> |
|
||||||
<TabIndex value="5" /> |
|
||||||
</System.Windows.Forms.Button> |
|
||||||
<System.Windows.Forms.Button> |
|
||||||
<Name value="addButton" /> |
|
||||||
<Location value="{X=128,Y=100}" /> |
|
||||||
<Text value="${res:Global.AddButtonText}" /> |
|
||||||
<TabIndex value="4" /> |
|
||||||
</System.Windows.Forms.Button> |
|
||||||
<System.Windows.Forms.Button> |
|
||||||
<Name value="removeButton" /> |
|
||||||
<Location value="{X=128,Y=156}" /> |
|
||||||
<Text value="${res:Global.RemoveButtonText}" /> |
|
||||||
<TabIndex value="6" /> |
|
||||||
</System.Windows.Forms.Button> |
|
||||||
<System.Windows.Forms.Label> |
|
||||||
<Name value="label2" /> |
|
||||||
<Text value="${res:Dialog.Options.IDEOptions.TaskListOptions.NameLabel}" /> |
|
||||||
<TextAlign value="BottomLeft" /> |
|
||||||
<Anchor value="Top, Left, Right" /> |
|
||||||
<TabIndex value="2" /> |
|
||||||
<Size value="{Width=136, Height=22}" /> |
|
||||||
<Location value="{X=128,Y=18}" /> |
|
||||||
</System.Windows.Forms.Label> |
|
||||||
<System.Windows.Forms.TextBox> |
|
||||||
<Name value="nameTextBox" /> |
|
||||||
<Anchor value="Top, Left, Right" /> |
|
||||||
<TabIndex value="3" /> |
|
||||||
<Location value="{X=128,Y=40}" /> |
|
||||||
<Size value="{Width=136, Height=21}" /> |
|
||||||
<Text value="" /> |
|
||||||
</System.Windows.Forms.TextBox> |
|
||||||
<System.Windows.Forms.Label> |
|
||||||
<Name value="label" /> |
|
||||||
<Text value="${res:Dialog.Options.IDEOptions.TaskListOptions.TokenListLabel}" /> |
|
||||||
<TextAlign value="BottomLeft" /> |
|
||||||
<TabIndex value="0" /> |
|
||||||
<Size value="{Width=112, Height=20}" /> |
|
||||||
<Location value="{X=8,Y=20}" /> |
|
||||||
</System.Windows.Forms.Label> |
|
||||||
<System.Windows.Forms.ListView> |
|
||||||
<Name value="taskListView" /> |
|
||||||
<MultiSelect value="False" /> |
|
||||||
<TabIndex value="1" /> |
|
||||||
<View value="Details" /> |
|
||||||
<Sorting value="Ascending" /> |
|
||||||
<FullRowSelect value="True" /> |
|
||||||
<Location value="{X=8,Y=40}" /> |
|
||||||
<Size value="{Width=112, Height=140}" /> |
|
||||||
<HeaderStyle value="None" /> |
|
||||||
<HideSelection value="False" /> |
|
||||||
<Columns> |
|
||||||
<System.Windows.Forms.ColumnHeader> |
|
||||||
<Width value="200" /> |
|
||||||
<Name value="columnHeader" /> |
|
||||||
<Text value="" /> |
|
||||||
</System.Windows.Forms.ColumnHeader> |
|
||||||
</Columns> |
|
||||||
</System.Windows.Forms.ListView> |
|
||||||
</Controls> |
|
||||||
</System.Windows.Forms.GroupBox> |
|
||||||
</Controls> |
|
||||||
</System.Windows.Forms.UserControl> |
|
||||||
<System.Windows.Forms.ColumnHeader> |
|
||||||
<Width value="70" /> |
|
||||||
<Name value="columnHeader3" /> |
|
||||||
<Text value="Template" /> |
|
||||||
</System.Windows.Forms.ColumnHeader> |
|
||||||
<System.Windows.Forms.ColumnHeader> |
|
||||||
<Width value="70" /> |
|
||||||
<Name value="columnHeader7" /> |
|
||||||
<Text value="${res:Dialog.Options.CodeTemplate.Template}" /> |
|
||||||
</System.Windows.Forms.ColumnHeader> |
|
||||||
<System.Windows.Forms.ColumnHeader> |
|
||||||
<Width value="140" /> |
|
||||||
<Name value="columnHeader6" /> |
|
||||||
<Text value="Description" /> |
|
||||||
</System.Windows.Forms.ColumnHeader> |
|
||||||
<System.Windows.Forms.ColumnHeader> |
|
||||||
<Width value="140" /> |
|
||||||
<Name value="columnHeader5" /> |
|
||||||
<Text value="${res:Dialog.Options.CodeTemplate.Description}" /> |
|
||||||
</System.Windows.Forms.ColumnHeader> |
|
||||||
<System.Windows.Forms.ColumnHeader> |
|
||||||
<Width value="140" /> |
|
||||||
<Name value="columnHeader4" /> |
|
||||||
<Text value="${res:Dialog.Options.CodeTemplate.Description}" /> |
|
||||||
</System.Windows.Forms.ColumnHeader> |
|
||||||
<System.Windows.Forms.ColumnHeader> |
|
||||||
<Width value="70" /> |
|
||||||
<Name value="columnHeader9" /> |
|
||||||
<Text value="${res:Dialog.Options.CodeTemplate.Template}" /> |
|
||||||
</System.Windows.Forms.ColumnHeader> |
|
||||||
<System.Windows.Forms.ColumnHeader> |
|
||||||
<Width value="140" /> |
|
||||||
<Name value="columnHeader8" /> |
|
||||||
<Text value="${res:Dialog.Options.CodeTemplate.Description}" /> |
|
||||||
</System.Windows.Forms.ColumnHeader> |
|
||||||
<System.Windows.Forms.ColumnHeader> |
|
||||||
<Width value="200" /> |
|
||||||
<Name value="columnHeader" /> |
|
||||||
<Text value="" /> |
|
||||||
</System.Windows.Forms.ColumnHeader> |
|
||||||
<System.Windows.Forms.ColumnHeader> |
|
||||||
<Width value="70" /> |
|
||||||
<Name value="columnHeader10" /> |
|
||||||
<Text value="${res:Dialog.Options.CodeTemplate.Template}" /> |
|
||||||
</System.Windows.Forms.ColumnHeader> |
|
||||||
</Components> |
|
@ -1,94 +0,0 @@ |
|||||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
|
||||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Collections.Generic; |
|
||||||
using System.Windows.Forms; |
|
||||||
|
|
||||||
using ICSharpCode.Core; |
|
||||||
|
|
||||||
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels |
|
||||||
{ |
|
||||||
public class TaskListOptions : XmlFormsOptionPanel |
|
||||||
{ |
|
||||||
const string taskListView = "taskListView"; |
|
||||||
const string nameTextBox = "nameTextBox"; |
|
||||||
const string changeButton = "changeButton"; |
|
||||||
const string removeButton = "removeButton"; |
|
||||||
const string addButton = "addButton"; |
|
||||||
ListView taskList; |
|
||||||
|
|
||||||
public override void LoadPanelContents() |
|
||||||
{ |
|
||||||
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.TaskListOptions.xfrm")); |
|
||||||
|
|
||||||
string[] tokens = ParserService.TaskListTokens; |
|
||||||
taskList = (ListView)ControlDictionary[taskListView]; |
|
||||||
taskList.BeginUpdate(); |
|
||||||
foreach (string token in tokens) { |
|
||||||
taskList.Items.Add(token); |
|
||||||
} |
|
||||||
taskList.EndUpdate(); |
|
||||||
taskList.SelectedIndexChanged += new EventHandler(TaskListViewSelectedIndexChanged); |
|
||||||
|
|
||||||
ControlDictionary[changeButton].Click += new EventHandler(ChangeButtonClick); |
|
||||||
ControlDictionary[removeButton].Click += new EventHandler(RemoveButtonClick); |
|
||||||
ControlDictionary[addButton].Click += new EventHandler(AddButtonClick); |
|
||||||
|
|
||||||
TaskListViewSelectedIndexChanged(this, EventArgs.Empty); |
|
||||||
} |
|
||||||
|
|
||||||
public override bool StorePanelContents() |
|
||||||
{ |
|
||||||
List<string> tokens = new List<string>(); |
|
||||||
|
|
||||||
foreach (ListViewItem item in taskList.Items) { |
|
||||||
string text = item.Text.Trim(); |
|
||||||
if (text.Length > 0) { |
|
||||||
tokens.Add(text); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
ParserService.TaskListTokens = tokens.ToArray(); |
|
||||||
|
|
||||||
return true; |
|
||||||
} |
|
||||||
|
|
||||||
void AddButtonClick(object sender, EventArgs e) |
|
||||||
{ |
|
||||||
string newItemText = ControlDictionary[nameTextBox].Text; |
|
||||||
foreach (ListViewItem item in ((ListView)ControlDictionary[taskListView]).Items) { |
|
||||||
if (item.Text == newItemText) { |
|
||||||
return; |
|
||||||
} |
|
||||||
} |
|
||||||
((ListView)ControlDictionary[taskListView]).Items.Add(new ListViewItem(newItemText)); |
|
||||||
} |
|
||||||
|
|
||||||
void ChangeButtonClick(object sender, EventArgs e) |
|
||||||
{ |
|
||||||
((ListView)ControlDictionary[taskListView]).SelectedItems[0].Text = ControlDictionary[nameTextBox].Text; |
|
||||||
} |
|
||||||
void RemoveButtonClick(object sender, EventArgs e) |
|
||||||
{ |
|
||||||
((ListView)ControlDictionary[taskListView]).Items.Remove(((ListView)ControlDictionary[taskListView]).SelectedItems[0]); |
|
||||||
} |
|
||||||
|
|
||||||
void TaskListViewSelectedIndexChanged(object sender, EventArgs e) |
|
||||||
{ |
|
||||||
if (((ListView)ControlDictionary[taskListView]).SelectedItems.Count > 0) { |
|
||||||
ControlDictionary[nameTextBox].Text = ((ListView)ControlDictionary[taskListView]).SelectedItems[0].Text; |
|
||||||
ControlDictionary[changeButton].Enabled = true; |
|
||||||
ControlDictionary[removeButton].Enabled = true; |
|
||||||
} else { |
|
||||||
ControlDictionary[nameTextBox].Text = String.Empty; |
|
||||||
ControlDictionary[changeButton].Enabled = false; |
|
||||||
ControlDictionary[removeButton].Enabled = false; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
public TaskListOptions() |
|
||||||
{ |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue