Browse Source

BuildOptions

pull/30/head
PeterForstmeier 13 years ago
parent
commit
ba29a73a6f
  1. 475
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptionsXaml.xaml
  2. 275
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptionsXaml.xaml.cs
  3. 1
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  4. 27
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/KeyValuePair.cs
  5. 23
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ProjectOptionPanel.cs

475
src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptionsXaml.xaml

@ -1,138 +1,192 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<optionpanels:ProjectOptionPanel <optionpanels:ProjectOptionPanel
x:Class="CSharpBinding.OptionPanels.BuildOptionsXaml" x:Class="CSharpBinding.OptionPanels.BuildOptionsXaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui;assembly=ICSharpCode.SharpDevelop" xmlns:core="http://icsharpcode.net/sharpdevelop/core" xmlns:optionpanels="clr-namespace:ICSharpCode.SharpDevelop.Gui.OptionPanels;assembly=ICSharpCode.SharpDevelop" xmlns:project="clr-namespace:ICSharpCode.SharpDevelop.Project;assembly=ICSharpCode.SharpDevelop" xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui;assembly=ICSharpCode.SharpDevelop"
xmlns:core="http://icsharpcode.net/sharpdevelop/core"
xmlns:optionpanels="clr-namespace:ICSharpCode.SharpDevelop.Gui.OptionPanels;assembly=ICSharpCode.SharpDevelop"
xmlns:project="clr-namespace:ICSharpCode.SharpDevelop.Project;assembly=ICSharpCode.SharpDevelop"
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets">
<optionpanels:ProjectOptionPanel.Resources> <optionpanels:ProjectOptionPanel.Resources>
<optionpanels:StringToBoolConverter x:Key="strTobool"></optionpanels:StringToBoolConverter> <optionpanels:StringToBoolConverter
x:Key="strTobool"></optionpanels:StringToBoolConverter>
</optionpanels:ProjectOptionPanel.Resources> </optionpanels:ProjectOptionPanel.Resources>
<ScrollViewer
<ScrollViewer VerticalScrollBarVisibility="Auto"> VerticalScrollBarVisibility="Auto">
<StackPanel Orientation="Vertical"> <StackPanel
Orientation="Vertical">
<GroupBox Header="{core:Localize Dialog.ProjectOptions.BuildOptions.General}"> <GroupBox
Header="{core:Localize Dialog.ProjectOptions.BuildOptions.General}">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition> <RowDefinition
<RowDefinition Height="30"></RowDefinition> Height="30"></RowDefinition>
<RowDefinition Height="30"></RowDefinition> <RowDefinition
<RowDefinition Height="30"></RowDefinition> Height="30"></RowDefinition>
<RowDefinition Height="30"></RowDefinition> <RowDefinition
<RowDefinition Height="30"></RowDefinition> Height="30"></RowDefinition>
<RowDefinition
Height="30"></RowDefinition>
<RowDefinition
Height="30"></RowDefinition>
<RowDefinition
Height="30"></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition <ColumnDefinition
Width="30"></ColumnDefinition> Width="30"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label
<Label Grid.ColumnSpan="2" Content="{core:Localize Dialog.ProjectOptions.BuildOptions.ConditionalSymbols}"></Label> Grid.ColumnSpan="2"
Content="{core:Localize Dialog.ProjectOptions.BuildOptions.ConditionalSymbols}"></Label>
<optionpanels:StorageLocationPicker Grid.Row="1" Location="{Binding DefineConstants.Location}" DockPanel.Dock="Left" /> <optionpanels:StorageLocationPicker
<TextBox x:Name="conditionalSymbolsTextBox" Margin="5,2,5,2" Grid.Row="1"
Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch" Location="{Binding DefineConstants.Location}"
DockPanel.Dock="Left" />
<TextBox
x:Name="conditionalSymbolsTextBox"
Margin="5,2,5,2"
Grid.Row="1"
Grid.Column="1"
HorizontalAlignment="Stretch"
Text="{Binding DefineConstants.Value, UpdateSourceTrigger=PropertyChanged}"></TextBox> Text="{Binding DefineConstants.Value, UpdateSourceTrigger=PropertyChanged}"></TextBox>
<optionpanels:StorageLocationPicker
<optionpanels:StorageLocationPicker Grid.Row="2" Location="{Binding Optimize.Location}" DockPanel.Dock="Left" /> Grid.Row="2"
<CheckBox x:Name="optimizeCodeCheckBox" Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Location="{Binding Optimize.Location}"
DockPanel.Dock="Left" />
<CheckBox
x:Name="optimizeCodeCheckBox"
Grid.Row="2"
Grid.Column="1"
VerticalAlignment="Center"
IsChecked="{Binding Optimize.Value,Converter={StaticResource strTobool}}" IsChecked="{Binding Optimize.Value,Converter={StaticResource strTobool}}"
Content="{core:Localize Dialog.ProjectOptions.BuildOptions.OptimizeCode}"></CheckBox> Content="{core:Localize Dialog.ProjectOptions.BuildOptions.OptimizeCode}"></CheckBox>
<optionpanels:StorageLocationPicker
<optionpanels:StorageLocationPicker Grid.Row="3" Location="{Binding AllowUnsafeBlocks.Location}" DockPanel.Dock="Left" /> Grid.Row="3"
<CheckBox x:Name="allowUnsafeCodeCheckBox" Location="{Binding AllowUnsafeBlocks.Location}"
Grid.Row="3" Grid.Column="1" VerticalAlignment="Center" DockPanel.Dock="Left" />
<CheckBox
x:Name="allowUnsafeCodeCheckBox"
Grid.Row="3"
Grid.Column="1"
VerticalAlignment="Center"
IsChecked="{Binding AllowUnsafeBlocks.Value,Converter={StaticResource strTobool}}" IsChecked="{Binding AllowUnsafeBlocks.Value,Converter={StaticResource strTobool}}"
Content="{core:Localize Dialog.ProjectOptions.BuildOptions.AllowUnsafeCode}"></CheckBox> Content="{core:Localize Dialog.ProjectOptions.BuildOptions.AllowUnsafeCode}"></CheckBox>
<optionpanels:StorageLocationPicker
Grid.Row="4"
<optionpanels:StorageLocationPicker Grid.Row="4" Location="{Binding CheckForOverflowUnderflow.Location}" DockPanel.Dock="Left" /> Location="{Binding CheckForOverflowUnderflow.Location}"
<CheckBox x:Name="checkForOverflowCheckBox" DockPanel.Dock="Left" />
Grid.Row="4" Grid.Column="1" VerticalAlignment="Center" <CheckBox
x:Name="checkForOverflowCheckBox"
Grid.Row="4"
Grid.Column="1"
VerticalAlignment="Center"
IsChecked="{Binding CheckForOverflowUnderflow.Value,Converter={StaticResource strTobool}}" IsChecked="{Binding CheckForOverflowUnderflow.Value,Converter={StaticResource strTobool}}"
Content="{core:Localize Dialog.ProjectOptions.BuildOptions.CheckForOverflow}"></CheckBox> Content="{core:Localize Dialog.ProjectOptions.BuildOptions.CheckForOverflow}"></CheckBox>
<optionpanels:StorageLocationPicker
Grid.Row="5"
<optionpanels:StorageLocationPicker Grid.Row="5" Location="{Binding NoStdLib.Location}" DockPanel.Dock="Left" /> Location="{Binding NoStdLib.Location}"
<CheckBox x:Name="noCorlibCheckBox" DockPanel.Dock="Left" />
Grid.Row="5" Grid.Column="1" VerticalAlignment="Center" <CheckBox
x:Name="noCorlibCheckBox"
Grid.Row="5"
Grid.Column="1"
VerticalAlignment="Center"
IsChecked="{Binding NoStdLib.Value,Converter={StaticResource strTobool}}" IsChecked="{Binding NoStdLib.Value,Converter={StaticResource strTobool}}"
Content="{core:Localize Dialog.ProjectOptions.BuildOptions.NoCorlib}"></CheckBox> Content="{core:Localize Dialog.ProjectOptions.BuildOptions.NoCorlib}"></CheckBox>
</Grid> </Grid>
</GroupBox> </GroupBox>
<GroupBox
<GroupBox Header="{core:Localize Dialog.ProjectOptions.Build.Output}"> Header="{core:Localize Dialog.ProjectOptions.Build.Output}">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="25"></RowDefinition> <RowDefinition
<RowDefinition Height="25"></RowDefinition> Height="25"></RowDefinition>
<RowDefinition Height="25"></RowDefinition> <RowDefinition
<RowDefinition Height="25"></RowDefinition> Height="25"></RowDefinition>
<RowDefinition Height="25"></RowDefinition> <RowDefinition
Height="25"></RowDefinition>
<RowDefinition
Height="25"></RowDefinition>
<RowDefinition
Height="25"></RowDefinition>
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="25"></ColumnDefinition> <ColumnDefinition
<ColumnDefinition Width="*"></ColumnDefinition> Width="25"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition> <ColumnDefinition
<ColumnDefinition Width="50"></ColumnDefinition> Width="*"></ColumnDefinition>
<ColumnDefinition
Width="3*"></ColumnDefinition>
<ColumnDefinition
Width="50"></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label Content="{core:Localize Dialog.ProjectOptions.Build.OutputPath}" Grid.ColumnSpan="2"></Label> <Label
Content="{core:Localize Dialog.ProjectOptions.Build.OutputPath}"
<optionpanels:StorageLocationPicker Grid.Row="1" Location="{Binding OutputPath.Location}" DockPanel.Dock="Left" /> Grid.ColumnSpan="2"></Label>
<TextBox x:Name="outputPathTextBox" <optionpanels:StorageLocationPicker
Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1"
Location="{Binding OutputPath.Location}"
DockPanel.Dock="Left" />
<TextBox
x:Name="outputPathTextBox"
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="2"
Text="{Binding OutputPath.Value, UpdateSourceTrigger=PropertyChanged}"></TextBox> Text="{Binding OutputPath.Value, UpdateSourceTrigger=PropertyChanged}"></TextBox>
<!--Combo Button etc missing -->
<Button <Button
Grid.Row="1" Grid.Row="1"
Grid.Column="3" Grid.Column="3"
Margin="3,0,3,0"
Content="..." Content="..."
Command="{Binding ChangeOutputPath}" Command="{Binding ChangeOutputPath}"></Button>
Margin="3,0,3,0"></Button>
<!-- Documentfile missing and only partial implemented --> <!-- Documentfile missing and only partial implemented -->
<optionpanels:StorageLocationPicker Grid.Row="2" Location="{Binding DocumentationFile.Location}" DockPanel.Dock="Left" /> <optionpanels:StorageLocationPicker
Grid.Row="2"
<CheckBox x:Name="xmlDocumentationCheckBox" Location="{Binding DocumentationFile.Location}"
Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" DockPanel.Dock="Left" />
<CheckBox
x:Name="xmlDocumentationCheckBox"
Grid.Row="2"
Grid.Column="1"
VerticalAlignment="Center"
IsChecked="{Binding DocumentFileIsChecked}"
Content="{core:Localize Dialog.ProjectOptions.Build.XmlDocumentationFile}"></CheckBox> Content="{core:Localize Dialog.ProjectOptions.Build.XmlDocumentationFile}"></CheckBox>
<TextBox
<TextBox x:Name="xmlDocumentationTextBox" Grid.ColumnSpan="2" x:Name="xmlDocumentationTextBox"
Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2"
Grid.Row="2"
Grid.Column="2"
IsEnabled="{Binding DocumentFileIsChecked}"
Text="{Binding DocumentationFile.Value, UpdateSourceTrigger=PropertyChanged}"></TextBox> Text="{Binding DocumentationFile.Value, UpdateSourceTrigger=PropertyChanged}"></TextBox>
<optionpanels:StorageLocationPicker
<!-- End of - Documentfile missing and only partial implemented --> Grid.Row="3"
Location="{Binding DebugType.Location}"
<optionpanels:StorageLocationPicker Grid.Row="3" Location="{Binding DebugType.Location}" DockPanel.Dock="Left" /> DockPanel.Dock="Left" />
<Label <Label
Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" Grid.Row="3"
Grid.Column="1"
HorizontalAlignment="Right"
Content="{core:Localize Dialog.ProjectOptions.Build.DebugInfo}"></Label> Content="{core:Localize Dialog.ProjectOptions.Build.DebugInfo}"></Label>
<!--Combo Save etc missing --> <!--Combo Save etc missing -->
<ComboBox <ComboBox
Grid.Row="3" Grid.Column="2" Width="150" HorizontalAlignment="Left" Grid.Row="3"
Grid.Column="2"
Width="150"
HorizontalAlignment="Left"
SelectedIndex="1" SelectedIndex="1"
gui:EnumBinding.EnumType="{x:Type project:DebugSymbolType}"> gui:EnumBinding.EnumType="{x:Type project:DebugSymbolType}"></ComboBox>
</ComboBox>
<Label <Label
Grid.Row="4" Grid.Column="1" HorizontalAlignment="Right" Grid.Row="4"
Grid.Column="1"
HorizontalAlignment="Right"
Content="{core:Localize Dialog.ProjectOptions.Build.TargetFramework}"></Label> Content="{core:Localize Dialog.ProjectOptions.Build.TargetFramework}"></Label>
<StackPanel <StackPanel
Orientation="Horizontal" Orientation="Horizontal"
Grid.Row="4" Grid.Row="4"
Grid.Column="2"> Grid.Column="2">
<ComboBox x:Name="targetFrameworkComboBox" <ComboBox
x:Name="targetFrameworkComboBox"
Width="200" Width="200"
IsEnabled="False" Margin="0,0,3,0"
Margin="0,0,3,0"></ComboBox> IsEnabled="False"></ComboBox>
<!-- Save etc missing -->
<Button <Button
Width="100" Width="100"
Content="Change" Content="Change"
@ -148,96 +202,227 @@
ShowGridLines="True"> ShowGridLines="True">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition <RowDefinition
Height="30"></RowDefinition> Height="25"></RowDefinition>
<RowDefinition <RowDefinition
Height="30"></RowDefinition> Height="25"></RowDefinition>
<RowDefinition <RowDefinition
Height="30"></RowDefinition> Height="25"></RowDefinition>
<RowDefinition <RowDefinition
Height="30"></RowDefinition> Height="25"></RowDefinition>
<RowDefinition></RowDefinition> <RowDefinition
Height="25"></RowDefinition>
<RowDefinition
Height="25"></RowDefinition>
<RowDefinition
Height="25"></RowDefinition>
<RowDefinition
Height="25"></RowDefinition>
<RowDefinition
Height="25"></RowDefinition>
<RowDefinition
Height="25"></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="25"></ColumnDefinition> <ColumnDefinition
Width="25"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition>
<ColumnDefinition Width="50"></ColumnDefinition> <ColumnDefinition
Width="50"></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<CheckBox
x:Name="registerCOMInteropCheckBox"
Grid.Column="2"
<CheckBox x:Name="registerCOMInteropCheckBox" Grid.Column="2" IsChecked="{Binding RegisterForComInterop.Value,Converter={StaticResource strTobool}}"
Content="{core:Localize Dialog.ProjectOptions.Build.RegisterForCOM}"></CheckBox> Content="{core:Localize Dialog.ProjectOptions.Build.RegisterForCOM}"></CheckBox>
<Label
<Label Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Grid.Row="1"
Grid.Column="1"
HorizontalAlignment="Right"
Content="{core:Localize Dialog.ProjectOptions.Build.GenerateSerializationAssembly}"></Label> Content="{core:Localize Dialog.ProjectOptions.Build.GenerateSerializationAssembly}"></Label>
<ComboBox x:Name="generateSerializationAssemblyComboBox" Grid.Row="1" Grid.Column="2"></ComboBox> <ComboBox
x:Name="generateSerializationAssemblyComboBox"
<optionpanels:StorageLocationPicker Grid.Row="2" Location="{Binding AssemblyName.Location}" DockPanel.Dock="Left" /> Grid.Row="1"
<Label Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" Content="{core:Localize Dialog.ProjectOptions.Build.TargetCPU}"></Label> Grid.Column="2"
<ComboBox x:Name="targetCpuComboBox" Grid.Row="2" Grid.Column="2"></ComboBox> ItemsSource="{Binding Path=DataContext.SerializationInfo}"
DisplayMemberPath="DisplayValue"
<Label Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" Content="{core:Localize Dialog.ProjectOptions.Build.FileAlignment}"></Label> SelectedValuePath="Key"
SelectedIndex="2"></ComboBox>
<ComboBox x:Name="fileAlignmentComboBox" Grid.Row="3" Grid.Column="2"></ComboBox> <optionpanels:StorageLocationPicker
Grid.Row="2"
Location="{Binding AssemblyName.Location}"
<Label Grid.Row="4" Grid.Column="1" HorizontalAlignment="Right" Content="{core:Localize Dialog.ProjectOptions.Build.DLLBaseAddress}"></Label> DockPanel.Dock="Left" />
<TextBox x:Name="dllBaseAddressTextBox" Grid.Row="4" Grid.Column="2"></TextBox> <Label
Grid.Row="2"
Grid.Column="1"
HorizontalAlignment="Right"
Content="{core:Localize Dialog.ProjectOptions.Build.TargetCPU}"></Label>
<ComboBox
x:Name="targetCpuComboBox"
Grid.Row="2"
Grid.Column="2"
ItemsSource="{Binding Path=DataContext.TargetCPU}"
DisplayMemberPath="DisplayValue"
SelectedValuePath="Key"
SelectedIndex="1"></ComboBox>
<Label
Grid.Row="3"
Grid.Column="1"
HorizontalAlignment="Right"
Content="{core:Localize Dialog.ProjectOptions.Build.FileAlignment}"></Label>
<ComboBox
x:Name="fileAlignmentComboBox"
Grid.Row="3"
Grid.Column="2"
ItemsSource="{Binding Path=DataContext.FileAlign}"
DisplayMemberPath="DisplayValue"
SelectedValuePath="Key"
SelectedIndex="3"></ComboBox>
<Label
Grid.Row="4"
Grid.Column="1"
HorizontalAlignment="Right"
Content="{core:Localize Dialog.ProjectOptions.Build.DLLBaseAddress}"></Label>
<!-- Hex binding -->
<TextBox
x:Name="dllBaseAddressTextBox"
Grid.Row="4"
Grid.Column="2"
Text="{Binding BaseAddress.Value, UpdateSourceTrigger=PropertyChanged}"></TextBox>
<Label
Grid.Row="6"
Grid.ColumnSpan="2"
Content="{core:Localize Dialog.ProjectOptions.Build.BaseIntermediateOutputPath}"></Label>
<optionpanels:StorageLocationPicker
Grid.Row="7"
Location="{Binding BaseIntermediateOutputPath.Location}"
DockPanel.Dock="Left" />
<TextBox
x:Name="baseIntermediateOutputPathTextBox"
Grid.Row="7"
Grid.Column="1"
Grid.ColumnSpan="2"
Text="{Binding BaseIntermediateOutputPath.Value, UpdateSourceTrigger=PropertyChanged}"></TextBox>
<Button
Grid.Row="7"
Grid.Column="4"
Margin="3,0,3,0"
Content="..."
Command="{Binding BaseIntermediateOutputPathCommand}"></Button>
<Label
Grid.Row="8"
Grid.ColumnSpan="2"
Content="{core:Localize Dialog.ProjectOptions.Build.IntermediateOutputPath}"></Label>
<optionpanels:StorageLocationPicker
Grid.Row="9"
Location="{Binding AssemblyName.Location}"
DockPanel.Dock="Left" />
<TextBox
x:Name="intermediateOutputPathTextBox"
Grid.Row="9"
Grid.Column="1"
Grid.ColumnSpan="2"
Text="{Binding IntermediateOutputPath.Value, UpdateSourceTrigger=PropertyChanged}"></TextBox>
<Button
Grid.Row="9"
Grid.Column="4"
Margin="3,0,3,0"
Content="..."
Command="{Binding IntermediateOutputPathCommand}"></Button>
</Grid> </Grid>
</GroupBox> </GroupBox>
</Grid> </Grid>
</GroupBox> </GroupBox>
<GroupBox
<GroupBox Margin="0,8,0,0" Margin="0,8,0,0"
Header="{core:Localize Dialog.ProjectOptions.Build.ErrorsAndWarnings}"> Header="{core:Localize Dialog.ProjectOptions.Build.ErrorsAndWarnings}">
<Grid ShowGridLines="True"> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="25"></ColumnDefinition> <ColumnDefinition
<ColumnDefinition Width="*"></ColumnDefinition> Width="25"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition> <ColumnDefinition
Width="*"></ColumnDefinition>
<ColumnDefinition
Width="3*"></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition> <RowDefinition
<RowDefinition Height="30"></RowDefinition> Height="25"></RowDefinition>
<RowDefinition
Height="25"></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label
<Label Grid.Column="1" Content="{core:Localize Dialog.ProjectOptions.Build.WarningLevel}"></Label> Grid.Column="1"
<ComboBox x:Name="warningLevelComboBox" Width="50" Grid.Column="2"></ComboBox> Content="{core:Localize Dialog.ProjectOptions.Build.WarningLevel}"></Label>
<!-- Bad Ischl -->
<optionpanels:StorageLocationPicker Grid.Row="1" Location="{Binding AssemblyName.Location}" DockPanel.Dock="Left" /> <ComboBox
x:Name="warningLevelComboBox"
<Label Grid.Row="1" Grid.Column="1" Content="{core:Localize Dialog.ProjectOptions.Build.SuppressWarnings}"></Label> Width="50"
<TextBox x:Name="suppressWarningsTextBox" Grid.Row="1" Grid.Column="2"></TextBox> Grid.Column="2"
HorizontalAlignment="Left"
ItemsSource="{Binding Path=DataContext.WarnLevel}"
DisplayMemberPath="DisplayValue"
SelectedValuePath="Key"
SelectedIndex="4"></ComboBox>
<optionpanels:StorageLocationPicker
Grid.Row="1"
Location="{Binding NoWarn.Location}"
DockPanel.Dock="Left" />
<Label
Grid.Row="1"
Grid.Column="1"
Content="{core:Localize Dialog.ProjectOptions.Build.SuppressWarnings}"></Label>
<TextBox
x:Name="suppressWarningsTextBox"
Grid.Row="1"
Grid.Column="2"
Text="{Binding NoWarn.Value, UpdateSourceTrigger=PropertyChanged}"></TextBox>
</Grid> </Grid>
</GroupBox> </GroupBox>
<GroupBox
<GroupBox Margin="0,8,0,0" Margin="0,8,0,0"
Header="{core:Localize Dialog.ProjectOptions.Build.TreatWarningsAsErrors}"> Header="{core:Localize Dialog.ProjectOptions.Build.TreatWarningsAsErrors}">
<Grid ShowGridLines="True"> <Grid
ShowGridLines="True">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="25"></ColumnDefinition> <ColumnDefinition
<ColumnDefinition Width="*"></ColumnDefinition> Width="25"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition> <ColumnDefinition
Width="*"></ColumnDefinition>
<ColumnDefinition
Width="3*"></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition> <RowDefinition
<RowDefinition Height="30"></RowDefinition> Height="30"></RowDefinition>
<RowDefinition Height="30"></RowDefinition> <RowDefinition
Height="30"></RowDefinition>
<RowDefinition
Height="30"></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<RadioButton
<RadioButton x:Name="noneRadioButton" Grid.Column="1" x:Name="noneRadioButton"
Grid.Column="1"
Content="{core:Localize Dialog.ProjectOptions.Build.TreatWarningsAsErrors.None}"></RadioButton> Content="{core:Localize Dialog.ProjectOptions.Build.TreatWarningsAsErrors.None}"></RadioButton>
<RadioButton
<RadioButton x:Name="specificWarningsRadioButton" Grid.Row="1" Grid.Column="1" x:Name="specificWarningsRadioButton"
Grid.Row="1"
Grid.Column="1"
Content="{core:Localize Dialog.ProjectOptions.Build.TreatWarningsAsErrors.Specific}"></RadioButton> Content="{core:Localize Dialog.ProjectOptions.Build.TreatWarningsAsErrors.Specific}"></RadioButton>
<TextBox Grid.Row="1" Grid.Column="2"></TextBox> <TextBox
x:Name="specificWarningsTextBox"
<RadioButton x:Name="allRadioButton" Grid.Row="2" Grid.Column="1" Grid.Row="1"
Grid.Column="2"
IsEnabled="{Binding ElementName=specificWarningsRadioButton, Path=IsChecked}"
Text="{Binding WarningsAsErrors.Value, UpdateSourceTrigger=PropertyChanged}"></TextBox>
<RadioButton
x:Name="allRadioButton"
Grid.Row="2"
Grid.Column="1"
Content="{core:Localize Dialog.ProjectOptions.Build.TreatWarningsAsErrors.All}"></RadioButton> Content="{core:Localize Dialog.ProjectOptions.Build.TreatWarningsAsErrors.All}"></RadioButton>
</Grid> </Grid>
</GroupBox> </GroupBox>
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
</optionpanels:ProjectOptionPanel> </optionpanels:ProjectOptionPanel>

275
src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptionsXaml.xaml.cs

@ -7,10 +7,13 @@
*/ */
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.IO;
using System.Linq; using System.Linq;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
using Gui.Dialogs.OptionPanels.ProjectOptions;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor;
@ -18,44 +21,81 @@ using ICSharpCode.SharpDevelop.Gui.OptionPanels;
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Project.Converter; using ICSharpCode.SharpDevelop.Project.Converter;
using ICSharpCode.SharpDevelop.Widgets; using ICSharpCode.SharpDevelop.Widgets;
using StringPair = System.Collections.Generic.KeyValuePair<string, string>;
namespace CSharpBinding.OptionPanels namespace CSharpBinding.OptionPanels
{ {
/// <summary> /// <summary>
/// Interaction logic for BuildOptionsXaml.xaml /// Interaction logic for BuildOptionsXaml.xaml
/// </summary> /// </summary>
/// /// SYST
public partial class BuildOptionsXaml : ProjectOptionPanel public partial class BuildOptionsXaml : ProjectOptionPanel
{ {
// private List<StringPair> fileAlignment;
private ICommand updateProjectCommand; private List<KeyItemPair> serializationInfo;
private ICommand changeOutputPath; private List<KeyItemPair> targetCPU;
private List<KeyItemPair> fileAlignment;
private List<KeyItemPair> warnLevel;
private System.Windows.Input.ICommand updateProjectCommand;
private System.Windows.Input.ICommand changeOutputPath;
private System.Windows.Input.ICommand baseIntermediateOutputPathCommand;
private System.Windows.Input.ICommand intermediateOutputPathCommand;
private MSBuildBasedProject project; private MSBuildBasedProject project;
public BuildOptionsXaml() public BuildOptionsXaml()
{ {
InitializeComponent(); InitializeComponent();
/*
fileAlignment = new List<StringPair>();
fileAlignment.Add( new StringPair("512", "512"));
fileAlignment.Add( new StringPair("1024", "1024"));
fileAlignment.Add(new StringPair("2048", "2048"));
fileAlignment.Add(new StringPair("4096", "4096"));
fileAlignment.Add(new StringPair("8192", "8192"));*/
} }
private void Initialize() private void Initialize()
{ {
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;
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;
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.UpdateProjectCommand = new RelayCommand(UpdateProjectExecute); this.UpdateProjectCommand = new RelayCommand(UpdateProjectExecute);
this.ChangeOutputPath = new RelayCommand(ChangeOutputPathExecute); this.ChangeOutputPath = new RelayCommand(ChangeOutputPathExecute);
UpdateTargetFrameworkCombo(); UpdateTargetFrameworkCombo();
XmlDocHelper();
this.BaseIntermediateOutputPathCommand = new RelayCommand(BaseIntermediateOutputPathExecute);
this.IntermediateOutputPathCommand = new RelayCommand(IntermediateOutputPathExecute);
this.warnLevel = new List<KeyItemPair>();
this.warnLevel.Add(new KeyItemPair("0","0"));
this.warnLevel.Add(new KeyItemPair("1","1"));
this.warnLevel.Add(new KeyItemPair("2","2"));
this.warnLevel.Add(new KeyItemPair("3","3"));
this.warnLevel.Add(new KeyItemPair("4","4"));
this.WarnLevel = warnLevel;
SetTreatWarningAsErrorRadioButtons();
LoadWarningsLevel();
base.RaisePropertyChanged(string.Empty);
} }
#region properties #region properties
public ProjectProperty<string> DefineConstants { public ProjectProperty<string> DefineConstants {
@ -86,18 +126,55 @@ namespace CSharpBinding.OptionPanels
get {return GetProperty("OutputPath", "", TextBoxEditMode.EditRawProperty); } get {return GetProperty("OutputPath", "", TextBoxEditMode.EditRawProperty); }
} }
// Documentfile missing and only partial implemented
public ProjectProperty<string> DocumentationFile { public ProjectProperty<string> DocumentationFile {
get {return GetProperty("DocumentationFile", "", TextBoxEditMode.EditRawProperty);} get {return GetProperty("DocumentationFile", "", TextBoxEditMode.EditRawProperty);}
} }
//
public ProjectProperty<DebugSymbolType> DebugType { public ProjectProperty<DebugSymbolType> DebugType {
get {return GetProperty("DebugType",ICSharpCode.SharpDevelop.Project.DebugSymbolType.Full ); } get {return GetProperty("DebugType",ICSharpCode.SharpDevelop.Project.DebugSymbolType.Full ); }
} }
public ProjectProperty<string> RegisterForComInterop {
get {return GetProperty("RegisterForComInterop","",TextBoxEditMode.EditRawProperty ); }
}
// Fehlt noch
public ProjectProperty<string> BaseAddress {
get {return GetProperty("BaseAddress","0x400000",TextBoxEditMode.EditRawProperty ); }
}
public ProjectProperty<string> BaseIntermediateOutputPath {
get {return GetProperty("BaseIntermediateOutputPath",@"obj\",TextBoxEditMode.EditRawProperty ); }
}
public ProjectProperty<string> IntermediateOutputPath {
get {return GetProperty("IntermediateOutputPath",@"obj\",TextBoxEditMode.EditRawProperty ); }
}
public ProjectProperty<string> WarningLevel {
get {return GetProperty("WarningLevel","4",TextBoxEditMode.EditRawProperty ); }
}
public ProjectProperty<string> NoWarn {
get {return GetProperty("NoWarn","",TextBoxEditMode.EditRawProperty ); }
}
public ProjectProperty<string> WarningsAsErrors {
get {return GetProperty("WarningsAsErrors","",TextBoxEditMode.EditRawProperty ); }
}
public ProjectProperty<string> TreatWarningsAsErrors {
get {return GetProperty("TreatWarningsAsErrors","false",TextBoxEditMode.EditRawProperty ); }
}
#endregion #endregion
#region overrides #region overrides
@ -109,12 +186,43 @@ namespace CSharpBinding.OptionPanels
this.Initialize(); this.Initialize();
} }
protected override bool Save(MSBuildBasedProject project, string configuration, string platform)
{
SaveTreatWarningAsErrorRadioButtons();
return base.Save(project, configuration, platform);
}
#endregion #endregion
#region Documentation File
#region Command Updateproject private bool documentFileIsChecked;
public bool DocumentFileIsChecked {
get { return documentFileIsChecked; }
set { documentFileIsChecked = value;
XmlDocHelper();
base.RaisePropertyChanged(() => DocumentFileIsChecked);
}
}
public ICommand UpdateProjectCommand { private void XmlDocHelper()
{
if (DocumentFileIsChecked) {
this.xmlDocumentationTextBox.Text = MSBuildInternals.Escape(
Path.ChangeExtension(ICSharpCode.Core.FileUtility.GetRelativePath(project.Directory, project.OutputAssemblyFullPath),
".xml"));
} else {
this.xmlDocumentationTextBox.Text = string.Empty;
}
}
#endregion
#region Command Update Project
public System.Windows.Input.ICommand UpdateProjectCommand {
get { return updateProjectCommand; } get { return updateProjectCommand; }
set { updateProjectCommand = value; set { updateProjectCommand = value;
base.RaisePropertyChanged(() =>this.UpdateProjectCommand); base.RaisePropertyChanged(() =>this.UpdateProjectCommand);
@ -141,7 +249,7 @@ namespace CSharpBinding.OptionPanels
#region ChangeOutputPathCommand #region ChangeOutputPathCommand
public ICommand ChangeOutputPath public System.Windows.Input.ICommand ChangeOutputPath
{ {
get {return this.changeOutputPath;} get {return this.changeOutputPath;}
set {this.changeOutputPath = value; set {this.changeOutputPath = value;
@ -158,16 +266,133 @@ namespace CSharpBinding.OptionPanels
#endregion #endregion
#region SerializationInfo
public List<KeyItemPair> SerializationInfo {
get {return this.serializationInfo;}
set {this.serializationInfo = value;
base.RaisePropertyChanged(() => SerializationInfo);
}
}
#endregion
#region TargetCPU
public List<KeyItemPair> TargetCPU {
get { return targetCPU; }
set { targetCPU = value;
base.RaisePropertyChanged(() => TargetCPU);
}
}
#endregion
//Property DebugType //Property DebugType
//void DebugSymbolsLoaded(object sender, EventArgs e) //void DebugSymbolsLoaded(object sender, EventArgs e)
#region FileAlignment #region FileAlignment
/*
public List<KeyValuePair<string, string>> FileAlign { public List<KeyItemPair> FileAlign {
get { return fileAlignment; } get { return fileAlignment; }
set { fileAlignment = value; } set { fileAlignment = value;
base.RaisePropertyChanged(() => FileAlign);
} }
*/ }
#endregion
#region BaseIntermediateOutputPath
public System.Windows.Input.ICommand BaseIntermediateOutputPathCommand {
get{return this.baseIntermediateOutputPathCommand;}
set {this.baseIntermediateOutputPathCommand = value;
base.RaisePropertyChanged(() => BaseIntermediateOutputPathCommand);}
}
private void BaseIntermediateOutputPathExecute ()
{
BaseIntermediateOutputPath.Value = base.BrowseForFolder("${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}",
base.BaseDirectory,baseIntermediateOutputPathTextBox.Text);
base.RaisePropertyChanged(()=> BaseIntermediateOutputPath);
}
#endregion
#region IntermediateOutputPath
public System.Windows.Input.ICommand IntermediateOutputPathCommand {
get{return this.baseIntermediateOutputPathCommand;}
set {this.intermediateOutputPathCommand = value;
base.RaisePropertyChanged(() => IntermediateOutputPathCommand);}
}
private void IntermediateOutputPathExecute ()
{
IntermediateOutputPath.Value = base.BrowseForFolder("${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}",
base.BaseDirectory,baseIntermediateOutputPathTextBox.Text);
base.RaisePropertyChanged(()=> IntermediateOutputPath);
}
#endregion
#region WarningLevel
public List<KeyItemPair> WarnLevel {
get { return warnLevel; }
set { warnLevel = value;
base.RaisePropertyChanged(() => WarnLevel);
}
}
private void LoadWarningsLevel ()
{
string val = WarningLevel.Value;
var i = WarnLevel.FindIndex(
delegate(KeyItemPair pair)
{
return pair.Key == val;
}
);
}
private void SaveWarningsLevel()
{
}
#endregion
#region SpecificWarnings TreatWarningsAsErrors
private void SetTreatWarningAsErrorRadioButtons()
{
if (bool.Parse(this.TreatWarningsAsErrors.Value)) {
this.allRadioButton.IsChecked = true;
} else {
if (WarningsAsErrors.Value.Length > 0) {
this.specificWarningsRadioButton.IsChecked = true;
} else {
this.noneRadioButton.IsChecked = true;
}
}
}
private void SaveTreatWarningAsErrorRadioButtons()
{
if ((bool)this.noneRadioButton.IsChecked){
this.specificWarningsTextBox.Text = string.Empty;
}
if ((bool)this.allRadioButton.IsChecked) {
this.TreatWarningsAsErrors.Value = "true";
} else {
this.TreatWarningsAsErrors.Value = "false";
}
}
#endregion #endregion
} }
} }

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

@ -277,6 +277,7 @@
<DependentUpon>DebugOptions.xaml</DependentUpon> <DependentUpon>DebugOptions.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\KeyValuePair.cs" />
<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"> <Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ReferencePathsXAML.xaml.cs">
<DependentUpon>ReferencePathsXAML.xaml</DependentUpon> <DependentUpon>ReferencePathsXAML.xaml</DependentUpon>

27
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/KeyValuePair.cs

@ -0,0 +1,27 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 09.05.2012
* Time: 19:54
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
namespace Gui.Dialogs.OptionPanels.ProjectOptions
{
/// <summary>
/// Description of KeyValuePair.
/// </summary>
public class KeyItemPair
{
public KeyItemPair(string key,string displayValue)
{
this.Key = key;
this.DisplayValue = displayValue;
}
public string Key {get;private set;}
public string DisplayValue {get; private set;}
}
}

23
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/ProjectOptionPanel.cs

@ -295,26 +295,28 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
#region INotifyPropertyChanged implementation #region INotifyPropertyChanged implementation
protected void RaisePropertyChanged(string propertyName)
{
RaiseInternal(propertyName);
}
protected void RaisePropertyChanged<T>(Expression<Func<T>> propertyExpresssion) protected void RaisePropertyChanged<T>(Expression<Func<T>> propertyExpresssion)
{ {
var propertyName = ExtractPropertyName(propertyExpresssion); var propertyName = ExtractPropertyName(propertyExpresssion);
//OnPropertyChanged(new System.ComponentModel.PropertyChangedEventArgs(propertyName)); RaiseInternal(propertyName);
var handler = this.PropertyChanged;
if (handler != null)
{
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
} }
/*
protected virtual void OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs e)
private void RaiseInternal (string propertyName)
{ {
var handler = this.PropertyChanged; var handler = this.PropertyChanged;
if (handler != null) if (handler != null)
{ {
handler(this, e); handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
} }
} }
*/
private static String ExtractPropertyName<T>(Expression<Func<T>> propertyExpresssion) private static String ExtractPropertyName<T>(Expression<Func<T>> propertyExpresssion)
{ {
if (propertyExpresssion == null) if (propertyExpresssion == null)
@ -342,6 +344,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
return memberExpression.Member.Name; return memberExpression.Member.Name;
} }
#endregion #endregion

Loading…
Cancel
Save