6 changed files with 382 additions and 187 deletions
@ -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> |
||||
@ -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…
Reference in new issue