Browse Source

Cleanup Signing.xaml

pull/30/head
PeterForstmeier 14 years ago
parent
commit
517eaf6cf2
  1. 79
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.xaml
  2. 9
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.xaml.cs

79
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.xaml

@ -9,14 +9,14 @@
<optionpanels:ProjectOptionPanel.Resources> <optionpanels:ProjectOptionPanel.Resources>
<local:StringToBoolConverter x:Key="strToBool"></local:StringToBoolConverter> <local:StringToBoolConverter x:Key="strToBool"></local:StringToBoolConverter>
<optionpanels:StorageLocationConverter x:Key="locationConverter" />
</optionpanels:ProjectOptionPanel.Resources> </optionpanels:ProjectOptionPanel.Resources>
<ScrollViewer VerticalScrollBarVisibility="Auto"> <ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel <StackPanel
Orientation="Vertical"> Orientation="Vertical">
<GroupBox <GroupBox Header="{core:Localize Dialog.ProjectOptions.Signing.StrongName}">
Header="{core:Localize Dialog.ProjectOptions.Signing.StrongName}">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition> <RowDefinition Height="30"></RowDefinition>
@ -31,60 +31,57 @@
<ColumnDefinition Width="*"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<CheckBox x:Name="signAssemblyCheckBox" <CheckBox x:Name="signAssemblyCheckBox" Grid.Column="1" VerticalAlignment="Bottom"
Grid.Column="1" VerticalAlignment="Bottom"
Content="{core:Localize Dialog.ProjectOptions.Signing.SignAssembly}" Content="{core:Localize Dialog.ProjectOptions.Signing.SignAssembly}"
IsChecked="{Binding SignAssembly.Value}"> IsChecked="{Binding SignAssembly.Value}">
</CheckBox> </CheckBox>
<Label Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" <Label Grid.Row="1" Grid.Column="1" VerticalAlignment="Center"
Content="{core:Localize Dialog.ProjectOptions.Signing.ChooseKeyFile}"></Label> Content="{core:Localize Dialog.ProjectOptions.Signing.ChooseKeyFile}">
</Label>
<optionpanels:StorageLocationPicker
Grid.Row="2"></optionpanels:StorageLocationPicker>
<ComboBox <optionpanels:StorageLocationPicker Grid.Row="2">
x:Name="keyFileComboBox" <optionpanels:StorageLocationPicker.Location>
Grid.Row="2" <MultiBinding Converter="{StaticResource locationConverter}">
Grid.Column="1" <Binding Path="SignAssembly.Location" />
VerticalAlignment="Center" <Binding Path="AssemblyOriginatorKeyFile.Location" />
Margin="3,3,3,3" <Binding Path="DelaySign.Location" />
IsEnabled="{Binding ElementName=signAssemblyCheckBox, Path=IsChecked}" </MultiBinding>
ItemsSource="{Binding KeyFile}" </optionpanels:StorageLocationPicker.Location>
SelectedValue="{Binding Path=SelectedKey}"> </optionpanels:StorageLocationPicker>
<ComboBox x:Name="keyFileComboBox" Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Margin="3,3,3,3"
IsEditable="True"
IsEnabled="{Binding ElementName=signAssemblyCheckBox, Path=IsChecked}"
ItemsSource="{Binding KeyFile}"
Text="{Binding AssemblyOriginatorKeyFile.Value,UpdateSourceTrigger=PropertyChanged}"
SelectedValue="{Binding Path=SelectedKey}">
</ComboBox> </ComboBox>
<Button <Button Grid.Row="2" Grid.Column="3" VerticalAlignment="Center" Margin="10,3,10,3"
x:Name="changePasswordButton" IsEnabled="False"
Grid.Row="2" Content="{core:Localize Dialog.ProjectOptions.Signing.ChangePassword}">
Grid.Column="3" </Button>
VerticalAlignment="Center"
IsEnabled="False"
Content="{core:Localize Dialog.ProjectOptions.Signing.ChangePassword}"
Margin="10,3,10,3"></Button>
<CheckBox <CheckBox x:Name="delaySignOnlyCheckBox" Grid.Row="3" Grid.Column="1" VerticalAlignment="Center"
x:Name="delaySignOnlyCheckBox" IsEnabled="{Binding ElementName=signAssemblyCheckBox, Path=IsChecked}"
Grid.Row="3" Content="{core:Localize Dialog.ProjectOptions.Signing.DelaySignOnly}"
Grid.Column="1" IsChecked="{Binding DelaySign.Value,Converter={StaticResource strToBool}}">
VerticalAlignment="Center"
IsEnabled="{Binding ElementName=signAssemblyCheckBox, Path=IsChecked}"
Content="{core:Localize Dialog.ProjectOptions.Signing.DelaySignOnly}"
IsChecked="{Binding DelaySign.Value,Converter={StaticResource strToBool}}">
</CheckBox> </CheckBox>
<Label <Label Grid.Row="4" Grid.Column="1" VerticalAlignment="Center"
Grid.Row="4"
Grid.Column="1" VerticalAlignment="Center"
IsEnabled="{Binding ElementName=signAssemblyCheckBox, Path=IsChecked}" IsEnabled="{Binding ElementName=signAssemblyCheckBox, Path=IsChecked}"
Content="{core:Localize Dialog.ProjectOptions.Signing.DelaySignWarning}"></Label> Content="{core:Localize Dialog.ProjectOptions.Signing.DelaySignWarning}">
</Label>
</Grid> </Grid>
</GroupBox> </GroupBox>
<GroupBox
Header="{core:Localize Dialog.ProjectOptions.Signing.ClickOnce}" <GroupBox Margin="0,20,0,0" Header="{core:Localize Dialog.ProjectOptions.Signing.ClickOnce}">
Margin="0,20,0,0">
<Label Content="{core:Localize Dialog.ProjectOptions.Signing.ClickOnceNotSupported}"></Label> <Label Content="{core:Localize Dialog.ProjectOptions.Signing.ClickOnceNotSupported}"></Label>
</GroupBox> </GroupBox>
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
</optionpanels:ProjectOptionPanel> </optionpanels:ProjectOptionPanel>

9
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.xaml.cs

@ -44,6 +44,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
keyFile.Add(StringParser.Parse("<${res:Global.BrowseText}...>")); keyFile.Add(StringParser.Parse("<${res:Global.BrowseText}...>"));
keyFileComboBox.SelectedIndex = 0; keyFileComboBox.SelectedIndex = 0;
keyFileComboBox.SelectionChanged += KeyFileComboBox_SelectionChanged; keyFileComboBox.SelectionChanged += KeyFileComboBox_SelectionChanged;
IsDirty = false;
} }
public ProjectProperty<bool> SignAssembly { public ProjectProperty<bool> SignAssembly {
@ -75,6 +76,13 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
protected override bool Save(MSBuildBasedProject project, string configuration, string platform) protected override bool Save(MSBuildBasedProject project, string configuration, string platform)
{ {
/*
helper.Saved += delegate {
if (Get<CheckBox>("signAssembly").Checked) {
helper.SetProperty("AssemblyOriginatorKeyMode", "File", true, signAssemblyBinding.Location);
}
};
*/
if (signAssemblyCheckBox.IsChecked == true) { if (signAssemblyCheckBox.IsChecked == true) {
this.AssemblyOriginatorKeyFile.Value = "File"; this.AssemblyOriginatorKeyFile.Value = "File";
} }
@ -128,6 +136,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
} }
} }
void KeyFileComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) void KeyFileComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
var cbo = (ComboBox) sender; var cbo = (ComboBox) sender;

Loading…
Cancel
Save