Browse Source

port SVN OptionPanel to WPF

pull/573/merge
Siegfried Pammer 11 years ago
parent
commit
6ce21c2b4e
  1. 50
      src/AddIns/VersionControl/SubversionAddIn/Resources/SubversionOptionsPanel.xfrm
  2. 58
      src/AddIns/VersionControl/SubversionAddIn/Src/Gui/SubversionOptionsPanel.cs
  3. 25
      src/AddIns/VersionControl/SubversionAddIn/Src/Gui/SubversionOptionsPanel.xaml
  4. 34
      src/AddIns/VersionControl/SubversionAddIn/Src/Gui/SubversionOptionsPanel.xaml.cs
  5. 25
      src/AddIns/VersionControl/SubversionAddIn/SubversionAddIn.csproj
  6. 2
      src/Main/Base/Project/Src/Gui/Dialogs/AbstractOptionPanel.cs

50
src/AddIns/VersionControl/SubversionAddIn/Resources/SubversionOptionsPanel.xfrm

@ -1,50 +0,0 @@ @@ -1,50 +0,0 @@
<Components version="1.0">
<System.Windows.Forms.UserControl>
<Name value="XmlUserControl1" />
<ClientSize value="{Width=296, Height=240}" />
<Controls>
<System.Windows.Forms.CheckBox>
<Name value="useHistoryDisplayBindingCheckBox" />
<Location value="8, 135" />
<Text value="${res:AddIns.Subversion.Options.UseHistoryDisplayBinding}" />
<TabIndex value="6" />
<Size value="280, 24" />
<UseVisualStyleBackColor value="True" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.CheckBox>
<Name value="autoRenameFilesCheckBox" />
<Location value="8, 63" />
<Text value="${res:AddIns.Subversion.Options.RenameInsideSubversion}" />
<TabIndex value="5" />
<Size value="280, 24" />
<Anchor value="Top, Left, Right" />
<UseVisualStyleBackColor value="True" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.CheckBox>
<Name value="autoDeleteFilesCheckBox" />
<Location value="8, 33" />
<Text value="${res:AddIns.Subversion.Options.AutoDelete}" />
<TabIndex value="3" />
<Size value="280, 24" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.CheckBox>
<Name value="autoReloadProjectCheckBox" />
<Location value="8, 105" />
<Text value="${res:AddIns.Subversion.Options.ReloadProjectAfterChanges}" />
<TabIndex value="4" />
<Size value="280, 24" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.CheckBox>
<Name value="autoAddFilesCheckBox" />
<Location value="8, 3" />
<Text value="${res:AddIns.Subversion.Options.AutoAdd}" />
<TabIndex value="2" />
<Size value="280, 24" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.CheckBox>
</Controls>
</System.Windows.Forms.UserControl>
</Components>

58
src/AddIns/VersionControl/SubversionAddIn/Src/Gui/SubversionOptionsPanel.cs

@ -1,58 +0,0 @@ @@ -1,58 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
using System;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.Svn.Gui
{
// TODO: rewrite without XMLForms
#pragma warning disable 618
/// <summary>
/// The Output Window options panel.
/// </summary>
public class SubversionOptionsPanel : XmlFormsOptionPanel
{
public SubversionOptionsPanel()
{
}
public override void LoadPanelContents()
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("ICSharpCode.Svn.Resources.SubversionOptionsPanel.xfrm"));
((CheckBox)ControlDictionary["autoAddFilesCheckBox"]).Checked = AddInOptions.AutomaticallyAddFiles;
((CheckBox)ControlDictionary["autoDeleteFilesCheckBox"]).Checked = AddInOptions.AutomaticallyDeleteFiles;
((CheckBox)ControlDictionary["autoRenameFilesCheckBox"]).Checked = AddInOptions.AutomaticallyRenameFiles;
((CheckBox)ControlDictionary["autoReloadProjectCheckBox"]).Checked = AddInOptions.AutomaticallyReloadProject;
((CheckBox)ControlDictionary["useHistoryDisplayBindingCheckBox"]).Checked = AddInOptions.UseHistoryDisplayBinding;
}
public override bool StorePanelContents()
{
AddInOptions.AutomaticallyAddFiles = ((CheckBox)ControlDictionary["autoAddFilesCheckBox"]).Checked;
AddInOptions.AutomaticallyDeleteFiles = ((CheckBox)ControlDictionary["autoDeleteFilesCheckBox"]).Checked;
AddInOptions.AutomaticallyRenameFiles = ((CheckBox)ControlDictionary["autoRenameFilesCheckBox"]).Checked;
AddInOptions.AutomaticallyReloadProject = ((CheckBox)ControlDictionary["autoReloadProjectCheckBox"]).Checked;
AddInOptions.UseHistoryDisplayBinding = ((CheckBox)ControlDictionary["useHistoryDisplayBindingCheckBox"]).Checked;
return true;
}
}
}

25
src/AddIns/VersionControl/SubversionAddIn/Src/Gui/SubversionOptionsPanel.xaml

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
<gui:OptionPanel x:Class="ICSharpCode.Svn.Gui.SubversionOptionsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:core="http://icsharpcode.net/sharpdevelop/core"
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"
xmlns:local="clr-namespace:ICSharpCode.Svn"
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui;assembly=ICSharpCode.SharpDevelop"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<widgets:StackPanelWithSpacing SpaceBetweenItems="10">
<CheckBox
Content="{core:Localize AddIns.Subversion.Options.UseHistoryDisplayBinding}"
IsChecked="{core:OptionBinding local:AddInOptions.UseHistoryDisplayBinding}" />
<CheckBox
Content="{core:Localize AddIns.Subversion.Options.RenameInsideSubversion}"
IsChecked="{core:OptionBinding local:AddInOptions.AutomaticallyRenameFiles}" />
<CheckBox
Content="{core:Localize AddIns.Subversion.Options.AutoDelete}"
IsChecked="{core:OptionBinding local:AddInOptions.AutomaticallyDeleteFiles}" />
<CheckBox
Content="{core:Localize AddIns.Subversion.Options.ReloadProjectAfterChanges}"
IsChecked="{core:OptionBinding local:AddInOptions.AutomaticallyReloadProject}" />
<CheckBox
Content="{core:Localize AddIns.Subversion.Options.AutoAdd}"
IsChecked="{core:OptionBinding local:AddInOptions.AutomaticallyAddFiles}" />
</widgets:StackPanelWithSpacing>
</gui:OptionPanel>

34
src/AddIns/VersionControl/SubversionAddIn/Src/Gui/SubversionOptionsPanel.xaml.cs

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.Svn.Gui
{
/// <summary>
/// Interaction logic for SubversionOptionsPanel.xaml
/// </summary>
public partial class SubversionOptionsPanel : OptionPanel
{
public SubversionOptionsPanel()
{
InitializeComponent();
}
}
}

25
src/AddIns/VersionControl/SubversionAddIn/SubversionAddIn.csproj

@ -45,6 +45,8 @@ @@ -45,6 +45,8 @@
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="SharpSvn">
<HintPath>..\..\..\Libraries\SharpSvn\SharpSvn.dll</HintPath>
</Reference>
@ -56,12 +58,20 @@ @@ -56,12 +58,20 @@
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\Main\GlobalAssemblyInfo.cs">
<Link>Configuration\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Src\Gui\SubversionOptionsPanel.xaml.cs">
<DependentUpon>SubversionOptionsPanel.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<None Include="ICSharpCode.Svn.addin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@ -73,7 +83,6 @@ @@ -73,7 +83,6 @@
</Compile>
<Compile Include="Src\AddInOptions.cs" />
<Compile Include="Configuration\AssemblyInfo.cs" />
<EmbeddedResource Include="Resources\SubversionOptionsPanel.xfrm" />
<Compile Include="Src\Commands\AutostartCommands.cs" />
<Compile Include="Src\Commands\ProjectBrowserCommands.cs" />
<Compile Include="Src\Gui\HistoryViewDisplayBinding\HistoryView.cs" />
@ -81,9 +90,6 @@ @@ -81,9 +90,6 @@
<Compile Include="Src\Gui\HistoryViewDisplayBinding\HistoryViewPanel.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Src\Gui\SubversionOptionsPanel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\ProjectBrowserVisitor\OverlayIconManager.cs" />
<Compile Include="Src\Gui\SvnGuiWrapper.cs" />
<Compile Include="Src\Gui\TortoiseSvnNotFoundForm.cs" />
@ -107,11 +113,22 @@ @@ -107,11 +113,22 @@
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\Main\ICSharpCode.Core.Presentation\ICSharpCode.Core.Presentation.csproj">
<Project>{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}</Project>
<Name>ICSharpCode.Core.Presentation</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Main\ICSharpCode.Core.WinForms\ICSharpCode.Core.WinForms.csproj">
<Project>{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}</Project>
<Name>ICSharpCode.Core.WinForms</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\Main\ICSharpCode.SharpDevelop.Widgets\Project\ICSharpCode.SharpDevelop.Widgets.csproj">
<Project>{8035765F-D51F-4A0C-A746-2FD100E19419}</Project>
<Name>ICSharpCode.SharpDevelop.Widgets</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="Src\Gui\SubversionOptionsPanel.xaml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
</Project>

2
src/Main/Base/Project/Src/Gui/Dialogs/AbstractOptionPanel.cs

@ -31,7 +31,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -31,7 +31,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// <summary>
/// Simple implementation of IOptionPanel with support for OptionBinding markup extensions.
/// </summary>
public class OptionPanel : UserControl, IOptionPanel, IOptionBindingContainer,INotifyPropertyChanged
public class OptionPanel : UserControl, IOptionPanel, IOptionBindingContainer, INotifyPropertyChanged
{
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

Loading…
Cancel
Save