Browse Source

Cleanup BuildOutput

pull/30/head
PeterForstmeier 14 years ago
parent
commit
42bbe19852
  1. 58
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.xaml
  2. 167
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.xaml.cs
  3. 5
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  4. 87
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/BuildAdvanced.xaml.cs
  5. 78
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/BuildOutput.xaml
  6. 174
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/BuildOutput.xaml.cs

58
src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.xaml

@ -76,6 +76,7 @@ @@ -76,6 +76,7 @@
<GroupBox
Header="{core:Localize Dialog.ProjectOptions.Build.Output}">
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
@ -91,65 +92,14 @@ @@ -91,65 +92,14 @@
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="50"></ColumnDefinition>
</Grid.ColumnDefinitions>
<optionpanels:BuildOutput x:Name="buildOutput" Grid.ColumnSpan="3">
</optionpanels:BuildOutput>
<Label Grid.ColumnSpan="2" Content="{core:Localize Dialog.ProjectOptions.Build.OutputPath}"></Label>
<optionpanels:StorageLocationPicker Grid.Row="1" DockPanel.Dock="Left"
Location="{Binding OutputPath.Location}"/>
<TextBox x:Name="outputPathTextBox" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
Text="{Binding OutputPath.Value, UpdateSourceTrigger=PropertyChanged}"></TextBox>
<Button Grid.Row="1" Grid.Column="3" Margin="3,0,3,0"
VerticalAlignment="Center"
Content="..."
Command="{Binding ChangeOutputPath}"></Button>
<optionpanels:StorageLocationPicker Grid.Row="2" DockPanel.Dock="Left" Location="{Binding DocumentationFile.Location}"/>
<CheckBox x:Name="xmlDocumentationCheckBox" Grid.Row="2" Grid.Column="1"
VerticalAlignment="Center"
Margin="3,0,3,0"
IsChecked="{Binding DocumentFileIsChecked}"
Content="{core:Localize Dialog.ProjectOptions.Build.XmlDocumentationFile}"></CheckBox>
<TextBox x:Name="xmlDocumentationTextBox" Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2"
IsEnabled="{Binding DocumentFileIsChecked}"
Text="{Binding DocumentationFile.Value, UpdateSourceTrigger=PropertyChanged}"></TextBox>
<optionpanels:StorageLocationPicker Grid.Row="3" DockPanel.Dock="Left" Location="{Binding DebugType.Location}" />
<Label Grid.Row="3" Grid.Column="1" Margin="3,0,3,0"
HorizontalAlignment="Right"
Content="{core:Localize Dialog.ProjectOptions.Build.DebugInfo}"></Label>
<ComboBox Grid.Row="3" Grid.Column="2" Width="150"
VerticalAlignment="Center"
HorizontalAlignment="Left"
SelectedValue="{Binding Path=DebugType.Value}"
gui:EnumBinding.EnumType="{x:Type project:DebugSymbolType}"></ComboBox>
<Label Grid.Row="4" Grid.Column="1" Margin="3,0,3,0"
HorizontalAlignment="Right"
Content="{core:Localize Dialog.ProjectOptions.Build.TargetFramework}"></Label>
<StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="2">
<ComboBox x:Name="targetFrameworkComboBox" Width="200" Margin="0,0,3,0"
VerticalAlignment="Center"
IsEnabled="False"></ComboBox>
<Button Margin="3,0,3,0" VerticalAlignment="Center"
Content="Change"
Command="{Binding UpdateProjectCommand}"
Style="{x:Static core:GlobalStyles.ButtonStyle}"></Button>
</StackPanel>
<GroupBox Grid.Row="5" Grid.ColumnSpan="4" Margin="5,10,0,0" Header="{core:Localize Dialog.ProjectOptions.Build.Advanced}">
<optionpanels:BuildAdvanced x:Name="buildAdvanced">
</optionpanels:BuildAdvanced>
</GroupBox>
</Grid>
</GroupBox>

167
src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.xaml.cs

@ -26,8 +26,8 @@ namespace CSharpBinding.OptionPanels @@ -26,8 +26,8 @@ namespace CSharpBinding.OptionPanels
public partial class BuildOptions : ProjectOptionPanel
{
private System.Windows.Input.ICommand updateProjectCommand;
private System.Windows.Input.ICommand changeOutputPath;
// private System.Windows.Input.ICommand updateProjectCommand;
// private System.Windows.Input.ICommand changeOutputPath;
public BuildOptions()
{
@ -63,19 +63,19 @@ namespace CSharpBinding.OptionPanels @@ -63,19 +63,19 @@ namespace CSharpBinding.OptionPanels
}
public ProjectProperty<string> OutputPath {
get {return GetProperty("OutputPath", "", TextBoxEditMode.EditRawProperty); }
}
public ProjectProperty<string> DocumentationFile {
get {return GetProperty("DocumentationFile", "", TextBoxEditMode.EditRawProperty);}
}
public ProjectProperty<DebugSymbolType> DebugType {
get {return GetProperty("DebugType",ICSharpCode.SharpDevelop.Project.DebugSymbolType.Full ); }
}
// public ProjectProperty<string> OutputPath {
// get {return GetProperty("OutputPath", "", TextBoxEditMode.EditRawProperty); }
// }
//
//
// public ProjectProperty<string> DocumentationFile {
// get {return GetProperty("DocumentationFile", "", TextBoxEditMode.EditRawProperty);}
// }
//
//
// public ProjectProperty<DebugSymbolType> DebugType {
// get {return GetProperty("DebugType",ICSharpCode.SharpDevelop.Project.DebugSymbolType.Full ); }
// }
#endregion
@ -84,19 +84,20 @@ namespace CSharpBinding.OptionPanels @@ -84,19 +84,20 @@ namespace CSharpBinding.OptionPanels
protected override void Initialize()
{
this.UpdateProjectCommand = new RelayCommand(UpdateProjectExecute);
this.ChangeOutputPath = new RelayCommand(ChangeOutputPathExecute);
UpdateTargetFrameworkCombo();
if (DocumentationFile.Value.Length > 0) {
documentFileIsChecked = true;
}
XmlDocHelper();
// this.UpdateProjectCommand = new RelayCommand(UpdateProjectExecute);
// this.ChangeOutputPath = new RelayCommand(ChangeOutputPathExecute);
// UpdateTargetFrameworkCombo();
// if (DocumentationFile.Value.Length > 0) {
// documentFileIsChecked = true;
// }
// XmlDocHelper();
}
protected override void Load(MSBuildBasedProject project, string configuration, string platform)
{
base.Load(project, configuration, platform);
buildOutput.SetProjectOptions(this);
this.buildAdvanced.SetProjectOptions(this);
this.errorsAndWarnings.SetProjectOptions(this);
this.treatErrorsAndWarnings.SetProjectOptions(this);
@ -106,84 +107,88 @@ namespace CSharpBinding.OptionPanels @@ -106,84 +107,88 @@ namespace CSharpBinding.OptionPanels
protected override bool Save(MSBuildBasedProject project, string configuration, string platform)
{
if (buildAdvanced.SaveProjectOptions()) {
// if (buildAdvanced.SaveProjectOptions()) {
treatErrorsAndWarnings.SaveProjectOptions();
return base.Save(project, configuration, platform);
}
return false;
// }
// return false;
}
#endregion
#region Documentation File
private bool documentFileIsChecked;
public bool DocumentFileIsChecked {
get { return documentFileIsChecked; }
set { documentFileIsChecked = value;
XmlDocHelper();
base.RaisePropertyChanged(() => DocumentFileIsChecked);
}
}
private void XmlDocHelper()
{
if (DocumentFileIsChecked) {
this.xmlDocumentationTextBox.Text = MSBuildInternals.Escape(
Path.ChangeExtension(ICSharpCode.Core.FileUtility.GetRelativePath(base.Project.Directory, base.Project.OutputAssemblyFullPath),
".xml"));
} else {
this.xmlDocumentationTextBox.Text = string.Empty;
}
}
#endregion
// #region Documentation File
//
// private bool documentFileIsChecked;
//
// public bool DocumentFileIsChecked {
// get { return documentFileIsChecked; }
// set { documentFileIsChecked = value;
// XmlDocHelper();
// base.RaisePropertyChanged(() => DocumentFileIsChecked);
// }
// }
//
// private void XmlDocHelper()
// {
// /*
// if (DocumentFileIsChecked) {
// this.xmlDocumentationTextBox.Text = MSBuildInternals.Escape(
// Path.ChangeExtension(ICSharpCode.Core.FileUtility.GetRelativePath(base.Project.Directory, base.Project.OutputAssemblyFullPath),
// ".xml"));
// } else {
// this.xmlDocumentationTextBox.Text = string.Empty;
// }
// */
// }
//
//
// #endregion
#region Command Update Project
public System.Windows.Input.ICommand UpdateProjectCommand {
get { return updateProjectCommand; }
set { updateProjectCommand = value;
base.RaisePropertyChanged(() =>this.UpdateProjectCommand);
}
}
// public System.Windows.Input.ICommand UpdateProjectCommand {
// get { return updateProjectCommand; }
// set { updateProjectCommand = value;
// base.RaisePropertyChanged(() =>this.UpdateProjectCommand);
// }
// }
private void UpdateProjectExecute ()
{
UpgradeViewContent.Show(base.Project.ParentSolution).Select(base.Project as IUpgradableProject);
this.UpdateTargetFrameworkCombo();
}
// private void UpdateProjectExecute ()
// {
// UpgradeViewContent.Show(base.Project.ParentSolution).Select(base.Project as IUpgradableProject);
//// this.UpdateTargetFrameworkCombo();
// }
private void UpdateTargetFrameworkCombo()
{
TargetFramework fx = ((IUpgradableProject)base.Project).CurrentTargetFramework;
if (fx != null) {
targetFrameworkComboBox.Items.Add(fx.DisplayName);
targetFrameworkComboBox.SelectedIndex = 0;
}
}
// private void UpdateTargetFrameworkCombo()
// {
// /*
// TargetFramework fx = ((IUpgradableProject)base.Project).CurrentTargetFramework;
// if (fx != null) {
// targetFrameworkComboBox.Items.Add(fx.DisplayName);
// targetFrameworkComboBox.SelectedIndex = 0;
// }
// */
// }
#endregion
#region ChangeOutputPathCommand
public System.Windows.Input.ICommand ChangeOutputPath
{
get {return this.changeOutputPath;}
set {this.changeOutputPath = value;
base.RaisePropertyChanged(() => this.ChangeOutputPath);
}
}
private void ChangeOutputPathExecute()
{
BrowseForFolder(OutputPath, "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}");
}
// public System.Windows.Input.ICommand ChangeOutputPath
// {
// get {return this.changeOutputPath;}
// set {this.changeOutputPath = value;
// base.RaisePropertyChanged(() => this.ChangeOutputPath);
// }
// }
// private void ChangeOutputPathExecute()
// {
//// BrowseForFolder(OutputPath, "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}");
// }
//
#endregion

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

@ -279,6 +279,10 @@ @@ -279,6 +279,10 @@
<DependentUpon>BuildAdvanced.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\BuildOutput.xaml.cs">
<DependentUpon>BuildOutput.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\DebugOptions.xaml.cs">
<DependentUpon>DebugOptions.xaml</DependentUpon>
<SubType>Code</SubType>
@ -924,6 +928,7 @@ @@ -924,6 +928,7 @@
<Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ApplicationSettings.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\BuildAdvanced.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\BuildEvents.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\BuildOutput.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\DebugOptions.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ErrorsAndWarnings.xaml" />
<Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\TreatErrorsAndWarnings.xaml" />

87
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/BuildAdvanced.xaml.cs

@ -28,10 +28,8 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -28,10 +28,8 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
/// </summary>
public partial class BuildAdvanced : UserControl,IProjectUserControl, INotifyPropertyChanged
{
private List<KeyItemPair> serializationInfo;
private List<KeyItemPair> targetCPU;
private string dllBaseAdress;
private List<KeyItemPair> fileAlignment;
private System.Windows.Input.ICommand baseIntermediateOutputPathCommand;
private System.Windows.Input.ICommand intermediateOutputPathCommand;
private ProjectOptionPanel projectOptions;
@ -39,28 +37,32 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -39,28 +37,32 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
public BuildAdvanced()
{
InitializeComponent();
InitializeCombos();
this.BaseIntermediateOutputPathCommand = new RelayCommand(BaseIntermediateOutputPathExecute);
this.IntermediateOutputPathCommand = new RelayCommand(IntermediateOutputPathExecute);
this.DataContext = this;
this.serializationInfo = new List<KeyItemPair>();
this.serializationInfo.Add (new KeyItemPair("Off",StringParser.Parse("${res:Dialog.ProjectOptions.Build.Off}")));
this.serializationInfo.Add (new KeyItemPair("On",StringParser.Parse("${res:Dialog.ProjectOptions.Build.On}")));
this.serializationInfo.Add (new KeyItemPair("Auto",StringParser.Parse( "${res:Dialog.ProjectOptions.Build.Auto}")));
this.SerializationInfo = this.serializationInfo;
}
void InitializeCombos()
{
this.SerializationInfo = new List<KeyItemPair>();
this.SerializationInfo.Add(new KeyItemPair("Off", StringParser.Parse("${res:Dialog.ProjectOptions.Build.Off}")));
this.SerializationInfo.Add(new KeyItemPair("On", StringParser.Parse("${res:Dialog.ProjectOptions.Build.On}")));
this.SerializationInfo.Add(new KeyItemPair("Auto", StringParser.Parse("${res:Dialog.ProjectOptions.Build.Auto}")));
this.targetCPU = new List<KeyItemPair>();
this.targetCPU.Add(new KeyItemPair( "AnyCPU",StringParser.Parse("${res:Dialog.ProjectOptions.Build.TargetCPU.Any}")));
this.targetCPU.Add(new KeyItemPair( "x86",StringParser.Parse("${res:Dialog.ProjectOptions.Build.TargetCPU.x86}")));
this.targetCPU.Add(new KeyItemPair( "x64",StringParser.Parse("${res:Dialog.ProjectOptions.Build.TargetCPU.x64}")));
this.targetCPU.Add(new KeyItemPair( "Itanium",StringParser.Parse("${res:Dialog.ProjectOptions.Build.TargetCPU.Itanium}")));
this.TargetCPU = targetCPU;
this.TargetCPU = new List<KeyItemPair>();
this.TargetCPU.Add(new KeyItemPair("AnyCPU", StringParser.Parse("${res:Dialog.ProjectOptions.Build.TargetCPU.Any}")));
this.TargetCPU.Add(new KeyItemPair("x86", StringParser.Parse("${res:Dialog.ProjectOptions.Build.TargetCPU.x86}")));
this.TargetCPU.Add(new KeyItemPair("x64", StringParser.Parse("${res:Dialog.ProjectOptions.Build.TargetCPU.x64}")));
this.TargetCPU.Add(new KeyItemPair("Itanium", StringParser.Parse("${res:Dialog.ProjectOptions.Build.TargetCPU.Itanium}")));
fileAlignment = new List<KeyItemPair>();
fileAlignment.Add( new KeyItemPair("512", "512"));
fileAlignment.Add( new KeyItemPair("1024", "1024"));
fileAlignment.Add(new KeyItemPair("2048", "2048"));
fileAlignment.Add(new KeyItemPair("4096", "4096"));
fileAlignment.Add(new KeyItemPair("8192", "8192"));
FileAlign = fileAlignment;
this.FileAlign = new List<KeyItemPair>();
this.FileAlign.Add(new KeyItemPair("512", "512"));
this.FileAlign.Add(new KeyItemPair("1024", "1024"));
this.FileAlign.Add(new KeyItemPair("2048", "2048"));
this.FileAlign.Add(new KeyItemPair("4096", "4096"));
this.FileAlign.Add(new KeyItemPair("8192", "8192"));
}
#region IProjectUserControl
@ -73,14 +75,12 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -73,14 +75,12 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
}
this.projectOptions = projectOptions;
this.BaseIntermediateOutputPathCommand = new RelayCommand(BaseIntermediateOutputPathExecute);
this.IntermediateOutputPathCommand = new RelayCommand(IntermediateOutputPathExecute);
int val;
if (!int.TryParse(BaseAddress.Value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out val)) {
val = 0x400000;
}
DllBaseAdress = "0x" + val.ToString("x", NumberFormatInfo.InvariantInfo);
projectOptions.IsDirty = true;
}
@ -108,34 +108,34 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -108,34 +108,34 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
#region Properies
public ProjectOptionPanel.ProjectProperty<bool> RegisterForComInterop {
get {return projectOptions.GetProperty("RegisterForComInterop", false, PropertyStorageLocations.PlatformSpecific ); }
get {return projectOptions.GetProperty("RegisterForComInterop", false, PropertyStorageLocations.PlatformSpecific ); }
}
public ProjectOptionPanel.ProjectProperty<string> GenerateSerializationAssemblies {
get {return projectOptions.GetProperty("GenerateSerializationAssemblies","Auto",
TextBoxEditMode.EditEvaluatedProperty, PropertyStorageLocations.PlatformSpecific ); }
TextBoxEditMode.EditEvaluatedProperty, PropertyStorageLocations.PlatformSpecific ); }
}
public ProjectOptionPanel.ProjectProperty<string> PlatformTarget {
get {return projectOptions.GetProperty("PlatformTarget","AnyCPU",
TextBoxEditMode.EditEvaluatedProperty, PropertyStorageLocations.PlatformSpecific ); }
TextBoxEditMode.EditEvaluatedProperty, PropertyStorageLocations.PlatformSpecific ); }
}
public ProjectOptionPanel.ProjectProperty<string> FileAlignment {
get {return projectOptions.GetProperty("FileAlignment","4096",
TextBoxEditMode.EditEvaluatedProperty, PropertyStorageLocations.PlatformSpecific ); }
TextBoxEditMode.EditEvaluatedProperty, PropertyStorageLocations.PlatformSpecific ); }
}
public ProjectOptionPanel.ProjectProperty<string> BaseAddress {
get {return projectOptions.GetProperty("BaseAddress","1000",
TextBoxEditMode.EditEvaluatedProperty,PropertyStorageLocations.PlatformSpecific ); }
TextBoxEditMode.EditEvaluatedProperty,PropertyStorageLocations.PlatformSpecific ); }
}
public ProjectOptionPanel.ProjectProperty<string> BaseIntermediateOutputPath {
get {return projectOptions.GetProperty("BaseIntermediateOutputPath",@"obj\",
TextBoxEditMode.EditRawProperty,PropertyStorageLocations.ConfigurationSpecific ); }
TextBoxEditMode.EditRawProperty,PropertyStorageLocations.ConfigurationSpecific ); }
}
@ -143,31 +143,14 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -143,31 +143,14 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
get {return projectOptions.GetProperty("IntermediateOutputPath",@"obj\$(Configuration)\",TextBoxEditMode.EditRawProperty ); }
}
#endregion
public List<KeyItemPair> SerializationInfo {
get {return this.serializationInfo;}
set {this.serializationInfo = value;
RaisePropertyChanged("SerializationInfo");
}
}
public List<KeyItemPair> TargetCPU {
get { return targetCPU; }
set { targetCPU = value;
RaisePropertyChanged("TargetCPU");
}
}
public List<KeyItemPair> SerializationInfo {get;set;}
public List<KeyItemPair> TargetCPU {get;set;}
public List<KeyItemPair> FileAlign {
get { return fileAlignment; }
set { fileAlignment = value;
RaisePropertyChanged("FileAlign");
}
}
public List<KeyItemPair> FileAlign {get;set;}
public string DllBaseAdress {

78
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/BuildOutput.xaml

@ -0,0 +1,78 @@ @@ -0,0 +1,78 @@
<UserControl x:Class="ICSharpCode.SharpDevelop.Gui.OptionPanels.BuildOutput"
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:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui"
xmlns:project="clr-namespace:ICSharpCode.SharpDevelop.Project"
xmlns:optionpanels="clr-namespace:ICSharpCode.SharpDevelop.Gui.OptionPanels">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="50"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Label Grid.ColumnSpan="2" Content="{core:Localize Dialog.ProjectOptions.Build.OutputPath}"></Label>
<optionpanels:StorageLocationPicker Grid.Row="1" DockPanel.Dock="Left"
Location="{Binding OutputPath.Location}"/>
<TextBox x:Name="outputPathTextBox" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
Text="{Binding OutputPath.Value, UpdateSourceTrigger=PropertyChanged}"></TextBox>
<Button Grid.Row="1" Grid.Column="3" Margin="3,0,3,0"
VerticalAlignment="Center"
Content="..."
Command="{Binding ChangeOutputPath}"></Button>
<optionpanels:StorageLocationPicker Grid.Row="2" DockPanel.Dock="Left" Location="{Binding DocumentationFile.Location}"/>
<CheckBox x:Name="xmlDocumentationCheckBox" Grid.Row="2" Grid.Column="1"
VerticalAlignment="Center"
Margin="3,0,3,0"
IsChecked="{Binding DocumentFileIsChecked}"
Content="{core:Localize Dialog.ProjectOptions.Build.XmlDocumentationFile}"></CheckBox>
<TextBox x:Name="xmlDocumentationTextBox" Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2"
IsEnabled="{Binding DocumentFileIsChecked}"
Text="{Binding DocumentationFile.Value, UpdateSourceTrigger=PropertyChanged}"></TextBox>
<optionpanels:StorageLocationPicker Grid.Row="3" DockPanel.Dock="Left" Location="{Binding DebugType.Location}" />
<Label Grid.Row="3" Grid.Column="1" Margin="3,0,3,0"
HorizontalAlignment="Right"
Content="{core:Localize Dialog.ProjectOptions.Build.DebugInfo}"></Label>
<ComboBox Grid.Row="3" Grid.Column="2" Width="150"
VerticalAlignment="Center"
HorizontalAlignment="Left"
SelectedValue="{Binding Path=DebugType.Value}"
gui:EnumBinding.EnumType="{x:Type project:DebugSymbolType}"></ComboBox>
<Label Grid.Row="4" Grid.Column="1" Margin="3,0,3,0"
HorizontalAlignment="Right"
Content="{core:Localize Dialog.ProjectOptions.Build.TargetFramework}"></Label>
<StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="2">
<ComboBox x:Name="targetFrameworkComboBox" Width="200" Margin="0,0,3,0"
VerticalAlignment="Center"
IsEnabled="False"></ComboBox>
<Button Margin="3,0,3,0" VerticalAlignment="Center"
Content="Change"
Command="{Binding UpdateProjectCommand}"
Style="{x:Static core:GlobalStyles.ButtonStyle}"></Button>
</StackPanel>
</Grid>
</UserControl>

174
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/BuildOutput.xaml.cs

@ -0,0 +1,174 @@ @@ -0,0 +1,174 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 30.09.2012
* Time: 17:46
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Project.Converter;
using ICSharpCode.SharpDevelop.Widgets;
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
{
/// <summary>
/// Interaction logic for BuildOutput.xaml
/// </summary>
public partial class BuildOutput : UserControl,IProjectUserControl, INotifyPropertyChanged
{
private ProjectOptionPanel projectOptions;
private System.Windows.Input.ICommand updateProjectCommand;
private System.Windows.Input.ICommand changeOutputPath;
public BuildOutput()
{
InitializeComponent();
this.UpdateProjectCommand = new RelayCommand(UpdateProjectExecute);
this.ChangeOutputPath = new RelayCommand(ChangeOutputPathExecute);
DataContext = this;
}
#region Properties
public ProjectOptionPanel.ProjectProperty<string> OutputPath {
get {return projectOptions.GetProperty("OutputPath", "", TextBoxEditMode.EditRawProperty); }
}
public ProjectOptionPanel.ProjectProperty<string> DocumentationFile {
get {return projectOptions.GetProperty("DocumentationFile", "", TextBoxEditMode.EditRawProperty);}
}
public ProjectOptionPanel.ProjectProperty<DebugSymbolType> DebugType {
get {return projectOptions.GetProperty("DebugType",ICSharpCode.SharpDevelop.Project.DebugSymbolType.Full ); }
}
#endregion
#region IProjectUserControl
public void SetProjectOptions(ProjectOptionPanel projectOptions)
{
if (projectOptions == null) {
throw new ArgumentNullException("projectOptions");
}
this.projectOptions = projectOptions;
UpdateTargetFrameworkCombo();
if (DocumentationFile.Value.Length > 0) {
documentFileIsChecked = true;
}
XmlDocHelper();
}
public bool SaveProjectOptions()
{
throw new NotImplementedException();
}
#endregion
#region Documentation File
private bool documentFileIsChecked;
public bool DocumentFileIsChecked {
get { return documentFileIsChecked; }
set { documentFileIsChecked = value;
XmlDocHelper();
RaisePropertyChanged("DocumentFileIsChecked");
}
}
private void XmlDocHelper()
{
if (DocumentFileIsChecked) {
this.xmlDocumentationTextBox.Text = MSBuildInternals.Escape(
Path.ChangeExtension(ICSharpCode.Core.FileUtility.GetRelativePath(projectOptions.Project.Directory,projectOptions.
Project.OutputAssemblyFullPath),
".xml"));
} else {
this.xmlDocumentationTextBox.Text = string.Empty;
}
}
#endregion
#region Command Update Project
public System.Windows.Input.ICommand UpdateProjectCommand {
get { return updateProjectCommand; }
set { updateProjectCommand = value;
RaisePropertyChanged("UpdateProjectCommand");
}
}
private void UpdateProjectExecute ()
{
UpgradeViewContent.Show(projectOptions.Project.ParentSolution).Select(projectOptions.Project as IUpgradableProject);
this.UpdateTargetFrameworkCombo();
}
private void UpdateTargetFrameworkCombo()
{
TargetFramework fx = ((IUpgradableProject)projectOptions.Project).CurrentTargetFramework;
if (fx != null) {
targetFrameworkComboBox.Items.Add(fx.DisplayName);
targetFrameworkComboBox.SelectedIndex = 0;
}
}
#endregion
#region ChangeOutputPathCommand
public System.Windows.Input.ICommand ChangeOutputPath
{
get {return this.changeOutputPath;}
set {this.changeOutputPath = value;
RaisePropertyChanged("ChangeOutputPath");
}
}
private void ChangeOutputPathExecute()
{
projectOptions.BrowseForFolder(OutputPath, "${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}");
}
#endregion
#region INotifyPropertyChanged
public event PropertyChangedEventHandler PropertyChanged;
private void RaisePropertyChanged (string propertyName)
{
var handler = this.PropertyChanged;
if (handler != null)
{
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
#endregion
}
}
Loading…
Cancel
Save