Browse Source

Change ProjectOptions.ReferencePaths.cs to WPF

pull/30/head
PeterForstmeier 14 years ago
parent
commit
7d26705e9f
  1. 7
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  2. 31
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ReferencePathsXAML.xaml
  3. 58
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ReferencePathsXAML.xaml.cs
  4. 2
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/old_ReferencePaths.cs

7
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -258,6 +258,10 @@
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ProjectOptionPanel.cs" /> <Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ProjectOptionPanel.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ReferencePathsXAML.xaml.cs">
<DependentUpon>ReferencePathsXAML.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\StorageLocationConverter.cs" /> <Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\StorageLocationConverter.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\StorageLocationPicker.cs" /> <Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\StorageLocationPicker.cs" />
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReferenceHelper.cs" /> <Compile Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReferenceHelper.cs" />
@ -727,7 +731,7 @@
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\Signing.cs"> <Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\Signing.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ReferencePaths.cs"> <Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\old_ReferencePaths.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\Publish.cs"> <Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\Publish.cs">
@ -882,6 +886,7 @@
<Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ProjectOptionPanel.xaml"> <Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ProjectOptionPanel.xaml">
<DependentUpon>ProjectOptionPanel.cs</DependentUpon> <DependentUpon>ProjectOptionPanel.cs</DependentUpon>
</Page> </Page>
<Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ReferencePathsXAML.xaml" />
<Page Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReference\AddServiceReferenceDialog.xaml" /> <Page Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReference\AddServiceReferenceDialog.xaml" />
<Page Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReference\AdvancedServiceDialog.xaml" /> <Page Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReference\AdvancedServiceDialog.xaml" />
<Page Include="Src\Services\RefactoringService\ContextActions\ContextActionsBulbControl.xaml" /> <Page Include="Src\Services\RefactoringService\ContextActions\ContextActionsBulbControl.xaml" />

31
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ReferencePathsXAML.xaml

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<optionpanels:ProjectOptionPanel
x:Class="ICSharpCode.SharpDevelop.Gui.OptionPanels.ReferencePaths"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:core="http://icsharpcode.net/sharpdevelop/core"
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"
xmlns:project="clr-namespace:ICSharpCode.SharpDevelop.Project"
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui"
xmlns:optionpanels="clr-namespace:ICSharpCode.SharpDevelop.Gui.OptionPanels">
<Grid>
<Grid.RowDefinitions>
<RowDefinition ></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="40"></ColumnDefinition>
<ColumnDefinition
Width="300"></ColumnDefinition>
</Grid.ColumnDefinitions>
<optionpanels:StorageLocationPicker Margin="5,40,0,0"
x:Name="location" Location="{Binding ReferencePath.Location}" />
<WindowsFormsHost Grid.Column="1" Grid.RowSpan="2">
<gui:StringListEditor x:Name="editor"/>
</WindowsFormsHost>
</Grid>
</optionpanels:ProjectOptionPanel>

58
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ReferencePathsXAML.xaml.cs

@ -0,0 +1,58 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 20.03.2012
* Time: 19:47
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
{
/// <summary>
/// Interaction logic for ReferencePathsXAML.xaml
/// </summary>
public partial class ReferencePaths : ProjectOptionPanel
{
public ReferencePaths()
{
InitializeComponent();
editor.BrowseForDirectory = true;
editor.ListCaption = StringParser.Parse("&${res:Dialog.ProjectOptions.ReferencePaths}:");
editor.TitleText = StringParser.Parse("&${res:Global.Folder}:");
editor.AddButtonText = StringParser.Parse("${res:Dialog.ProjectOptions.ReferencePaths.AddPath}");
editor.ListChanged += delegate { IsDirty = true; };
}
public ProjectProperty<string> ReferencePath {
get {
return GetProperty("ReferencePath", "",TextBoxEditMode.EditEvaluatedProperty);
}
}
protected override void Load(MSBuildBasedProject project, string configuration, string platform)
{
base.Load(project, configuration, platform);
string prop = GetProperty("ReferencePath", "", TextBoxEditMode.EditRawProperty).Value.ToString();
string[] values = prop.Split(';');
if (values.Length == 1 && values[0].Length == 0) {
editor.LoadList(new string[0]);
} else {
editor.LoadList(values);
}
}
protected override bool Save(MSBuildBasedProject project, string configuration, string platform)
{
ReferencePath.Value = String.Join(";", editor.GetList());
return base.Save(project, configuration, platform);
}
}
}

2
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ReferencePaths.cs → src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/old_ReferencePaths.cs

@ -7,7 +7,7 @@ using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
{ {
public class ReferencePaths : AbstractXmlFormsProjectOptionPanel public class old_ReferencePaths : AbstractXmlFormsProjectOptionPanel
{ {
public override void LoadPanelContents() public override void LoadPanelContents()
{ {
Loading…
Cancel
Save