Skip to content
This repository
  • 2 commits
  • 6 files changed
  • 0 comments
  • 1 contributor
5 src/Main/Base/Project/ICSharpCode.SharpDevelop.addin
@@ -1186,15 +1186,18 @@
1186 1186 <OptionPanel id = "LoadSave"
1187 1187 label = "${res:Dialog.Options.IDEOptions.LoadSaveOptions.PanelName}"
1188 1188 class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.LoadSaveOptions"/>
  1189 +
1189 1190 <OptionPanel id = "TaskListOptions"
1190 1191 label = "${res:Dialog.Options.IDEOptions.TaskListOptions.PanelName}"
1191   - class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.TaskListOptions"/>
  1192 + class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.TaskListXaml"/>
  1193 +
1192 1194 <OptionPanel id = "OutputWindowOptions"
1193 1195 label = "${res:Dialog.Options.IDEOptions.OutputPanel.Title}"
1194 1196 class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.OutputWindowOptionsPanel"/>
1195 1197 <OptionPanel id = "ProjectAndSolutionOptions"
1196 1198 label = "${res:Dialog.Options.IDEOptions.ProjectAndSolutionOptions.PanelName}"
1197 1199 class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.ProjectAndSolutionOptions"/>
  1200 +
1198 1201 </OptionPanel>
1199 1202 <OptionPanel id = "CodingOptions"
1200 1203 label = "${res:Dialog.Options.IDEOptions.CodingOptionsText}">
9 src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
@@ -249,6 +249,10 @@
249 249 <DependentUpon>SelectCulturePanel.xaml</DependentUpon>
250 250 <SubType>Code</SubType>
251 251 </Compile>
  252 + <Compile Include="Src\Gui\Dialogs\OptionPanels\IDEOptions\TaskListOptionsl.xaml.cs">
  253 + <DependentUpon>TaskListOptionsl.xaml</DependentUpon>
  254 + <SubType>Code</SubType>
  255 + </Compile>
252 256 <Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\DebugOptions.xaml.cs">
253 257 <DependentUpon>DebugOptions.xaml</DependentUpon>
254 258 <SubType>Code</SubType>
@@ -575,9 +579,6 @@
575 579 <Compile Include="Src\Internal\ConditionEvaluators\IsProcessRunningEvaluator.cs" />
576 580 <Compile Include="Src\Internal\Doozers\PadDoozer.cs" />
577 581 <Compile Include="Src\Gui\Pads\CompilerMessageView\MessageViewCategory.cs" />
578   - <Compile Include="Src\Gui\Dialogs\OptionPanels\IDEOptions\TaskListOptions.cs">
579   - <SubType>UserControl</SubType>
580   - </Compile>
581 582 <Compile Include="Src\Internal\ConditionEvaluators\ActiveContentExtensionEvaluator.cs" />
582 583 <Compile Include="Src\Gui\Workbench\ViewContentEventHandler.cs" />
583 584 <Compile Include="Src\Services\Debugger\IDebugger.cs" />
@@ -698,7 +699,6 @@
698 699 <EmbeddedResource Include="Resources\NewFileDialog.xfrm" />
699 700 <EmbeddedResource Include="Resources\OutputWindowOptionsPanel.xfrm" />
700 701 <EmbeddedResource Include="Resources\SelectStylePanel.xfrm" />
701   - <EmbeddedResource Include="Resources\TaskListOptions.xfrm" />
702 702 <EmbeddedResource Include="Resources\WordCountDialog.xfrm" />
703 703 <Compile Include="Src\Bookmarks\BookmarkBase.cs" />
704 704 <Compile Include="Src\Bookmarks\Commands\MenuCommands.cs" />
@@ -874,6 +874,7 @@
874 874 </ItemGroup>
875 875 <ItemGroup>
876 876 <Page Include="Src\Bookmarks\Pad\Controls\ListViewPad.xaml" />
  877 + <Page Include="Src\Gui\Dialogs\OptionPanels\IDEOptions\TaskListOptionsl.xaml" />
877 878 <Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\BuildEvents.xaml" />
878 879 <Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\DebugOptions.xaml" />
879 880 <Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ProjectOptionPanel.xaml">
126 src/Main/Base/Project/Resources/TaskListOptions.xfrm
... ... @@ -1,126 +0,0 @@
1   -<Components version="1.0">
2   - <System.Windows.Forms.UserControl>
3   - <Name value="MyUserControl" />
4   - <DockPadding value="" />
5   - <ClientSize value="{Width=280, Height=296}" />
6   - <Controls>
7   - <System.Windows.Forms.GroupBox>
8   - <Name value="groupBox" />
9   - <TabIndex value="0" />
10   - <Location value="{X=4,Y=8}" />
11   - <Anchor value="Top, Left, Right" />
12   - <Size value="{Width=272, Height=188}" />
13   - <Text value="${res:Dialog.Options.IDEOptions.TaskListOptions.CommentTagsGroupBox}" />
14   - <Controls>
15   - <System.Windows.Forms.Button>
16   - <Name value="changeButton" />
17   - <Location value="{X=128,Y=128}" />
18   - <Text value="${res:Global.ChangeButtonText}" />
19   - <TabIndex value="5" />
20   - </System.Windows.Forms.Button>
21   - <System.Windows.Forms.Button>
22   - <Name value="addButton" />
23   - <Location value="{X=128,Y=100}" />
24   - <Text value="${res:Global.AddButtonText}" />
25   - <TabIndex value="4" />
26   - </System.Windows.Forms.Button>
27   - <System.Windows.Forms.Button>
28   - <Name value="removeButton" />
29   - <Location value="{X=128,Y=156}" />
30   - <Text value="${res:Global.RemoveButtonText}" />
31   - <TabIndex value="6" />
32   - </System.Windows.Forms.Button>
33   - <System.Windows.Forms.Label>
34   - <Name value="label2" />
35   - <Text value="${res:Dialog.Options.IDEOptions.TaskListOptions.NameLabel}" />
36   - <TextAlign value="BottomLeft" />
37   - <Anchor value="Top, Left, Right" />
38   - <TabIndex value="2" />
39   - <Size value="{Width=136, Height=22}" />
40   - <Location value="{X=128,Y=18}" />
41   - </System.Windows.Forms.Label>
42   - <System.Windows.Forms.TextBox>
43   - <Name value="nameTextBox" />
44   - <Anchor value="Top, Left, Right" />
45   - <TabIndex value="3" />
46   - <Location value="{X=128,Y=40}" />
47   - <Size value="{Width=136, Height=21}" />
48   - <Text value="" />
49   - </System.Windows.Forms.TextBox>
50   - <System.Windows.Forms.Label>
51   - <Name value="label" />
52   - <Text value="${res:Dialog.Options.IDEOptions.TaskListOptions.TokenListLabel}" />
53   - <TextAlign value="BottomLeft" />
54   - <TabIndex value="0" />
55   - <Size value="{Width=112, Height=20}" />
56   - <Location value="{X=8,Y=20}" />
57   - </System.Windows.Forms.Label>
58   - <System.Windows.Forms.ListView>
59   - <Name value="taskListView" />
60   - <MultiSelect value="False" />
61   - <TabIndex value="1" />
62   - <View value="Details" />
63   - <Sorting value="Ascending" />
64   - <FullRowSelect value="True" />
65   - <Location value="{X=8,Y=40}" />
66   - <Size value="{Width=112, Height=140}" />
67   - <HeaderStyle value="None" />
68   - <HideSelection value="False" />
69   - <Columns>
70   - <System.Windows.Forms.ColumnHeader>
71   - <Width value="200" />
72   - <Name value="columnHeader" />
73   - <Text value="" />
74   - </System.Windows.Forms.ColumnHeader>
75   - </Columns>
76   - </System.Windows.Forms.ListView>
77   - </Controls>
78   - </System.Windows.Forms.GroupBox>
79   - </Controls>
80   - </System.Windows.Forms.UserControl>
81   - <System.Windows.Forms.ColumnHeader>
82   - <Width value="70" />
83   - <Name value="columnHeader3" />
84   - <Text value="Template" />
85   - </System.Windows.Forms.ColumnHeader>
86   - <System.Windows.Forms.ColumnHeader>
87   - <Width value="70" />
88   - <Name value="columnHeader7" />
89   - <Text value="${res:Dialog.Options.CodeTemplate.Template}" />
90   - </System.Windows.Forms.ColumnHeader>
91   - <System.Windows.Forms.ColumnHeader>
92   - <Width value="140" />
93   - <Name value="columnHeader6" />
94   - <Text value="Description" />
95   - </System.Windows.Forms.ColumnHeader>
96   - <System.Windows.Forms.ColumnHeader>
97   - <Width value="140" />
98   - <Name value="columnHeader5" />
99   - <Text value="${res:Dialog.Options.CodeTemplate.Description}" />
100   - </System.Windows.Forms.ColumnHeader>
101   - <System.Windows.Forms.ColumnHeader>
102   - <Width value="140" />
103   - <Name value="columnHeader4" />
104   - <Text value="${res:Dialog.Options.CodeTemplate.Description}" />
105   - </System.Windows.Forms.ColumnHeader>
106   - <System.Windows.Forms.ColumnHeader>
107   - <Width value="70" />
108   - <Name value="columnHeader9" />
109   - <Text value="${res:Dialog.Options.CodeTemplate.Template}" />
110   - </System.Windows.Forms.ColumnHeader>
111   - <System.Windows.Forms.ColumnHeader>
112   - <Width value="140" />
113   - <Name value="columnHeader8" />
114   - <Text value="${res:Dialog.Options.CodeTemplate.Description}" />
115   - </System.Windows.Forms.ColumnHeader>
116   - <System.Windows.Forms.ColumnHeader>
117   - <Width value="200" />
118   - <Name value="columnHeader" />
119   - <Text value="" />
120   - </System.Windows.Forms.ColumnHeader>
121   - <System.Windows.Forms.ColumnHeader>
122   - <Width value="70" />
123   - <Name value="columnHeader10" />
124   - <Text value="${res:Dialog.Options.CodeTemplate.Template}" />
125   - </System.Windows.Forms.ColumnHeader>
126   -</Components>
94 src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/IDEOptions/TaskListOptions.cs
... ... @@ -1,94 +0,0 @@
1   -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2   -// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
3   -
4   -using System;
5   -using System.Collections.Generic;
6   -using System.Windows.Forms;
7   -
8   -using ICSharpCode.Core;
9   -
10   -namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
11   -{
12   - public class TaskListOptions : XmlFormsOptionPanel
13   - {
14   - const string taskListView = "taskListView";
15   - const string nameTextBox = "nameTextBox";
16   - const string changeButton = "changeButton";
17   - const string removeButton = "removeButton";
18   - const string addButton = "addButton";
19   - ListView taskList;
20   -
21   - public override void LoadPanelContents()
22   - {
23   - SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.TaskListOptions.xfrm"));
24   -
25   - string[] tokens = ParserService.TaskListTokens;
26   - taskList = (ListView)ControlDictionary[taskListView];
27   - taskList.BeginUpdate();
28   - foreach (string token in tokens) {
29   - taskList.Items.Add(token);
30   - }
31   - taskList.EndUpdate();
32   - taskList.SelectedIndexChanged += new EventHandler(TaskListViewSelectedIndexChanged);
33   -
34   - ControlDictionary[changeButton].Click += new EventHandler(ChangeButtonClick);
35   - ControlDictionary[removeButton].Click += new EventHandler(RemoveButtonClick);
36   - ControlDictionary[addButton].Click += new EventHandler(AddButtonClick);
37   -
38   - TaskListViewSelectedIndexChanged(this, EventArgs.Empty);
39   - }
40   -
41   - public override bool StorePanelContents()
42   - {
43   - List<string> tokens = new List<string>();
44   -
45   - foreach (ListViewItem item in taskList.Items) {
46   - string text = item.Text.Trim();
47   - if (text.Length > 0) {
48   - tokens.Add(text);
49   - }
50   - }
51   -
52   - ParserService.TaskListTokens = tokens.ToArray();
53   -
54   - return true;
55   - }
56   -
57   - void AddButtonClick(object sender, EventArgs e)
58   - {
59   - string newItemText = ControlDictionary[nameTextBox].Text;
60   - foreach (ListViewItem item in ((ListView)ControlDictionary[taskListView]).Items) {
61   - if (item.Text == newItemText) {
62   - return;
63   - }
64   - }
65   - ((ListView)ControlDictionary[taskListView]).Items.Add(new ListViewItem(newItemText));
66   - }
67   -
68   - void ChangeButtonClick(object sender, EventArgs e)
69   - {
70   - ((ListView)ControlDictionary[taskListView]).SelectedItems[0].Text = ControlDictionary[nameTextBox].Text;
71   - }
72   - void RemoveButtonClick(object sender, EventArgs e)
73   - {
74   - ((ListView)ControlDictionary[taskListView]).Items.Remove(((ListView)ControlDictionary[taskListView]).SelectedItems[0]);
75   - }
76   -
77   - void TaskListViewSelectedIndexChanged(object sender, EventArgs e)
78   - {
79   - if (((ListView)ControlDictionary[taskListView]).SelectedItems.Count > 0) {
80   - ControlDictionary[nameTextBox].Text = ((ListView)ControlDictionary[taskListView]).SelectedItems[0].Text;
81   - ControlDictionary[changeButton].Enabled = true;
82   - ControlDictionary[removeButton].Enabled = true;
83   - } else {
84   - ControlDictionary[nameTextBox].Text = String.Empty;
85   - ControlDictionary[changeButton].Enabled = false;
86   - ControlDictionary[removeButton].Enabled = false;
87   - }
88   - }
89   -
90   - public TaskListOptions()
91   - {
92   - }
93   - }
94   -}
74 src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/IDEOptions/TaskListOptionsl.xaml
... ... @@ -0,0 +1,74 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<gui:OptionPanel
  3 + x:Class="ICSharpCode.SharpDevelop.Gui.OptionPanels.TaskListXaml"
  4 + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  5 + xmlns:core="http://icsharpcode.net/sharpdevelop/core"
  6 + xmlns:sd="clr-namespace:ICSharpCode.SharpDevelop"
  7 + xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui"
  8 + xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"
  9 + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  10 + xmlns:local="clr-namespace:ICSharpCode.SharpDevelop.Gui.OptionPanels">
  11 + <GroupBox
  12 + Header="Comment Tags">
  13 + <Grid
  14 + Margin="5">
  15 + <Grid.RowDefinitions>
  16 + <RowDefinition
  17 + Height="30"></RowDefinition>
  18 + <RowDefinition
  19 + Height="30"></RowDefinition>
  20 + <RowDefinition
  21 + Height="20"></RowDefinition>
  22 + <RowDefinition
  23 + Height="30"></RowDefinition>
  24 + <RowDefinition
  25 + Height="30"></RowDefinition>
  26 + <RowDefinition
  27 + Height="30"></RowDefinition>
  28 + </Grid.RowDefinitions>
  29 + <Grid.ColumnDefinitions>
  30 + <ColumnDefinition></ColumnDefinition>
  31 + <ColumnDefinition></ColumnDefinition>
  32 + </Grid.ColumnDefinitions>
  33 + <TextBlock
  34 + Text="Token List"></TextBlock>
  35 + <ListView
  36 + x:Name="listView"
  37 + Margin="5,0,5,5"
  38 + Grid.Row="1"
  39 + Grid.RowSpan="6"
  40 + SelectionChanged="ListView_SelectionChanged"></ListView>
  41 + <TextBlock
  42 + Text="Name"
  43 + Margin="5,0,0,0"
  44 + Grid.Column="1"></TextBlock>
  45 + <TextBox
  46 + x:Name="taskText"
  47 + Margin="5,0,5,0"
  48 + Grid.Column="1"
  49 + Grid.Row="1"></TextBox>
  50 + <Button
  51 + Content="Add"
  52 + Click="AddButton_Click"
  53 + Margin="5,2,5, 3"
  54 + Grid.Row="3"
  55 + Grid.Column="1"></Button>
  56 + <Button
  57 + x:Name="changeBtn"
  58 + Content="Change"
  59 + IsEnabled="False"
  60 + Click="ChangeBtn_Click"
  61 + Grid.Row="4"
  62 + Grid.Column="1"
  63 + Margin="5,3,5,3"></Button>
  64 + <Button
  65 + x:Name="removeBtn"
  66 + Click="RemoveBtn_Click"
  67 + Margin="5,2,5,5"
  68 + Content="Remove"
  69 + Grid.Row="5"
  70 + Grid.Column="1"
  71 + IsEnabled="False"></Button>
  72 + </Grid>
  73 + </GroupBox>
  74 +</gui:OptionPanel>
92 src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/IDEOptions/TaskListOptionsl.xaml.cs
... ... @@ -0,0 +1,92 @@
  1 +/*
  2 + * Created by SharpDevelop.
  3 + * User: Peter Forstmeier
  4 + * Date: 26.02.2012
  5 + * Time: 19:46
  6 + *
  7 + * To change this template use Tools | Options | Coding | Edit Standard Headers.
  8 + */
  9 +using System;
  10 +using System.Collections.Generic;
  11 +using System.Text;
  12 +using System.Windows;
  13 +using System.Windows.Controls;
  14 +using System.Windows.Data;
  15 +using System.Windows.Documents;
  16 +using System.Windows.Input;
  17 +using System.Windows.Media;
  18 +
  19 +using ICSharpCode.SharpDevelop.Gui;
  20 +
  21 +namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
  22 +{
  23 + /// <summary>
  24 + /// Interaction logic for TaskListXaml.xaml
  25 + /// </summary>
  26 + public partial class TaskListXaml : OptionPanel
  27 + {
  28 + public TaskListXaml()
  29 + {
  30 + InitializeComponent();
  31 + string[] tokens = ParserService.TaskListTokens;
  32 + foreach (var token in tokens) {
  33 + listView.Items.Add(token);
  34 + };
  35 + }
  36 +
  37 +
  38 + void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
  39 + {
  40 + if (listView.SelectedItem != null) {
  41 + taskText.Text = listView.SelectedItem.ToString();
  42 + changeBtn.IsEnabled = true;
  43 + removeBtn.IsEnabled = true;
  44 + }
  45 + }
  46 +
  47 +
  48 + void ChangeBtn_Click(object sender, RoutedEventArgs e)
  49 + {
  50 + if ((listView.SelectedItem != null) && (!String.IsNullOrWhiteSpace(taskText.Text))) {
  51 + var i = listView.Items.IndexOf(listView.SelectedItem);
  52 + listView.Items[i] = taskText.Text;
  53 + }
  54 + }
  55 +
  56 +
  57 + void RemoveBtn_Click(object sender, RoutedEventArgs e)
  58 + {
  59 + if (listView.SelectedItem != null) {
  60 + listView.Items.Remove(listView.SelectedItem);
  61 + taskText.Text = String.Empty;
  62 + }
  63 + }
  64 +
  65 +
  66 + void AddButton_Click(object sender, RoutedEventArgs e)
  67 + {
  68 + if (!String.IsNullOrWhiteSpace(taskText.Text)) {
  69 + var i = listView.Items.IndexOf(taskText.Text);
  70 + if (i < 0) {
  71 +
  72 + listView.Items.Add(taskText.Text);
  73 + }
  74 + }
  75 + }
  76 +
  77 +
  78 + public override bool SaveOptions()
  79 + {
  80 + List<string> tokens = new List<string>();
  81 +
  82 + foreach (var item in listView.Items) {
  83 + string text = item.ToString().Trim();
  84 + if (text.Length > 0) {
  85 + tokens.Add(text);
  86 + }
  87 + }
  88 + ParserService.TaskListTokens = tokens.ToArray();
  89 + return true;
  90 + }
  91 + }
  92 +}

No commit comments for this range

Something went wrong with that request. Please try again.