Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5631 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61pull/1/head
14 changed files with 133 additions and 326 deletions
@ -1,98 +0,0 @@
@@ -1,98 +0,0 @@
|
||||
<Components version="1.0"> |
||||
<System.Windows.Forms.UserControl> |
||||
<Name value="MyUserControl" /> |
||||
<ClientSize value="{Width=280, Height=332}" /> |
||||
<Controls> |
||||
<System.Windows.Forms.GroupBox> |
||||
<Name value="groupBox1" /> |
||||
<Location value="8, 226" /> |
||||
<Text value="Delete" /> |
||||
<Size value="264, 51" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="2" /> |
||||
<Controls> |
||||
<System.Windows.Forms.CheckBox> |
||||
<Name value="useRecycleBinCheckBox" /> |
||||
<Location value="8, 19" /> |
||||
<Text value="${res:Dialog.Options.IDEOptions.LoadSaveOptions.UseRecycleBin}" /> |
||||
<TabIndex value="0" /> |
||||
<Size value="248, 24" /> |
||||
<UseVisualStyleBackColor value="True" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
</System.Windows.Forms.CheckBox> |
||||
</Controls> |
||||
</System.Windows.Forms.GroupBox> |
||||
<System.Windows.Forms.GroupBox> |
||||
<Name value="groupBox2" /> |
||||
<Location value="8, 108" /> |
||||
<Text value="${res:Dialog.Options.IDEOptions.LoadSaveOptions.SaveLabel}" /> |
||||
<Size value="264, 112" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="1" /> |
||||
<Controls> |
||||
<System.Windows.Forms.ComboBox> |
||||
<Name value="lineTerminatorStyleComboBox" /> |
||||
<TabIndex value="2" /> |
||||
<Location value="8, 72" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<Size value="104, 21" /> |
||||
<DropDownStyle value="DropDownList" /> |
||||
</System.Windows.Forms.ComboBox> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="label" /> |
||||
<Location value="8, 49" /> |
||||
<Text value="${res:Dialog.Options.IDEOptions.LoadSaveOptions.LineTerminatorStyleGroupBox}" /> |
||||
<Size value="248, 23" /> |
||||
<TextAlign value="BottomLeft" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="1" /> |
||||
</System.Windows.Forms.Label> |
||||
<System.Windows.Forms.CheckBox> |
||||
<Name value="createBackupCopyCheckBox" /> |
||||
<Location value="8, 25" /> |
||||
<Text value="${res:Dialog.Options.IDEOptions.LoadSaveOptions.CreateBackupCopyCheckBox}" /> |
||||
<TabIndex value="0" /> |
||||
<Size value="248, 24" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
</System.Windows.Forms.CheckBox> |
||||
</Controls> |
||||
</System.Windows.Forms.GroupBox> |
||||
<System.Windows.Forms.GroupBox> |
||||
<Name value="groupBox" /> |
||||
<Location value="8, 8" /> |
||||
<Text value="${res:Dialog.Options.IDEOptions.LoadSaveOptions.LoadLabel}" /> |
||||
<Size value="264, 94" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="0" /> |
||||
<Controls> |
||||
<System.Windows.Forms.CheckBox> |
||||
<Name value="autoLoadExternalChangesCheckBox" /> |
||||
<Location value="21, 64" /> |
||||
<Text value="${res:Dialog.Options.IDEOptions.LoadSaveOptions.AutoLoadExternalChanges}" /> |
||||
<TabIndex value="2" /> |
||||
<Size value="235, 24" /> |
||||
<UseVisualStyleBackColor value="True" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
</System.Windows.Forms.CheckBox> |
||||
<System.Windows.Forms.CheckBox> |
||||
<Name value="detectExternalChangesCheckBox" /> |
||||
<Location value="8, 46" /> |
||||
<Text value="${res:Dialog.Options.IDEOptions.LoadSaveOptions.DetectExternalChanges}" /> |
||||
<TabIndex value="1" /> |
||||
<Size value="248, 24" /> |
||||
<UseVisualStyleBackColor value="True" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
</System.Windows.Forms.CheckBox> |
||||
<System.Windows.Forms.CheckBox> |
||||
<Name value="loadUserDataCheckBox" /> |
||||
<Location value="8, 25" /> |
||||
<Text value="${res:Dialog.Options.IDEOptions.LoadSaveOptions.LoadUserDataCheckBox}" /> |
||||
<TabIndex value="0" /> |
||||
<Size value="248, 24" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
</System.Windows.Forms.CheckBox> |
||||
</Controls> |
||||
</System.Windows.Forms.GroupBox> |
||||
</Controls> |
||||
</System.Windows.Forms.UserControl> |
||||
</Components> |
@ -0,0 +1,47 @@
@@ -0,0 +1,47 @@
|
||||
<gui:OptionPanel x:Class="ICSharpCode.SharpDevelop.Gui.OptionPanels.LoadSaveOptions" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:core="http://icsharpcode.net/sharpdevelop/core" |
||||
xmlns:sd="clr-namespace:ICSharpCode.SharpDevelop" |
||||
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:local="clr-namespace:ICSharpCode.SharpDevelop.Gui.OptionPanels"> |
||||
<StackPanel> |
||||
<GroupBox Header="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.LoadLabel}"> |
||||
<StackPanel> |
||||
<CheckBox Content="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.LoadUserDataCheckBox}" |
||||
IsChecked="{core:OptionBinding gui:WpfWorkbench.LoadDocumentProperties}" /> |
||||
<CheckBox Name="detectExternalChanges" |
||||
Content="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.DetectExternalChanges}" |
||||
IsChecked="{core:OptionBinding sd:FileChangeWatcher.DetectExternalChangesOption}" /> |
||||
<CheckBox Content="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.AutoLoadExternalChanges}" |
||||
Margin="8,0,0,0" |
||||
IsEnabled="{Binding IsChecked, ElementName=detectExternalChanges}" |
||||
IsChecked="{core:OptionBinding sd:FileChangeWatcher.AutoLoadExternalChangesOption}" /> |
||||
</StackPanel> |
||||
</GroupBox> |
||||
<GroupBox Header="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.SaveLabel}"> |
||||
<StackPanel> |
||||
<CheckBox Content="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.CreateBackupCopyCheckBox}" |
||||
IsChecked="{core:OptionBinding sd:FileService.SaveUsingTemporaryFile}" /> |
||||
<Label |
||||
Content="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.DefaultFileEncoding}" |
||||
Target="{Binding ElementName=encodingComboBox}" /> |
||||
<ComboBox |
||||
Name="encodingComboBox" |
||||
Margin="8,0,4,4" |
||||
ItemsSource="{x:Static sd:FileService.AllEncodings}" |
||||
SelectedItem="{core:OptionBinding sd:FileService.DefaultFileEncoding}"> |
||||
<ComboBox.ItemTemplate> |
||||
<DataTemplate> |
||||
<TextBlock Text="{Binding DisplayName}" /> |
||||
</DataTemplate> |
||||
</ComboBox.ItemTemplate> |
||||
</ComboBox> |
||||
</StackPanel> |
||||
</GroupBox> |
||||
<GroupBox Header="{core:Localize Global.Delete}"> |
||||
<CheckBox Content="{core:Localize Dialog.Options.IDEOptions.LoadSaveOptions.UseRecycleBin}" |
||||
IsChecked="{core:OptionBinding sd:FileService.DeleteToRecycleBin}" /> |
||||
</GroupBox> |
||||
</StackPanel> |
||||
</gui:OptionPanel> |
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <author name="Daniel Grunwald"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
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.Core; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels |
||||
{ |
||||
public partial class LoadSaveOptions : OptionPanel |
||||
{ |
||||
public LoadSaveOptions() |
||||
{ |
||||
InitializeComponent(); |
||||
} |
||||
} |
||||
} |
@ -1,71 +0,0 @@
@@ -1,71 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
using ICSharpCode.Core; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels |
||||
{ |
||||
public enum LineTerminatorStyle { |
||||
Windows, |
||||
Macintosh, |
||||
Unix |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Summary description for Form1.
|
||||
/// </summary>
|
||||
public class LoadSavePanel : XmlFormsOptionPanel |
||||
{ |
||||
const string loadUserDataCheckBox = "loadUserDataCheckBox"; |
||||
const string createBackupCopyCheckBox = "createBackupCopyCheckBox"; |
||||
const string lineTerminatorStyleComboBox = "lineTerminatorStyleComboBox"; |
||||
|
||||
CheckBox autoLoadExternalChangesCheckBox, detectExternalChangesCheckBox, useRecycleBinCheckBox; |
||||
|
||||
public override void LoadPanelContents() |
||||
{ |
||||
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.LoadSaveOptionPanel.xfrm")); |
||||
|
||||
((CheckBox)ControlDictionary[loadUserDataCheckBox]).Checked = PropertyService.Get("SharpDevelop.LoadDocumentProperties", true); |
||||
((CheckBox)ControlDictionary[createBackupCopyCheckBox]).Checked = FileService.SaveUsingTemporaryFile; |
||||
|
||||
((ComboBox)ControlDictionary[lineTerminatorStyleComboBox]).Items.Add(StringParser.Parse("${res:Dialog.Options.IDEOptions.LoadSaveOptions.WindowsRadioButton}")); |
||||
((ComboBox)ControlDictionary[lineTerminatorStyleComboBox]).Items.Add(StringParser.Parse("${res:Dialog.Options.IDEOptions.LoadSaveOptions.MacintoshRadioButton}")); |
||||
((ComboBox)ControlDictionary[lineTerminatorStyleComboBox]).Items.Add(StringParser.Parse("${res:Dialog.Options.IDEOptions.LoadSaveOptions.UnixRadioButton}")); |
||||
|
||||
((ComboBox)ControlDictionary[lineTerminatorStyleComboBox]).SelectedIndex = (int)(LineTerminatorStyle)PropertyService.Get("SharpDevelop.LineTerminatorStyle", LineTerminatorStyle.Windows); |
||||
|
||||
autoLoadExternalChangesCheckBox = Get<CheckBox>("autoLoadExternalChanges"); |
||||
detectExternalChangesCheckBox = Get<CheckBox>("detectExternalChanges"); |
||||
useRecycleBinCheckBox = Get<CheckBox>("useRecycleBin"); |
||||
|
||||
detectExternalChangesCheckBox.CheckedChanged += delegate { |
||||
autoLoadExternalChangesCheckBox.Enabled = detectExternalChangesCheckBox.Checked; |
||||
}; |
||||
autoLoadExternalChangesCheckBox.Enabled = detectExternalChangesCheckBox.Checked; |
||||
|
||||
detectExternalChangesCheckBox.Checked = FileChangeWatcher.DetectExternalChangesOption; |
||||
autoLoadExternalChangesCheckBox.Checked = FileChangeWatcher.AutoLoadExternalChangesOption; |
||||
useRecycleBinCheckBox.Checked = FileService.DeleteToRecycleBin; |
||||
} |
||||
|
||||
public override bool StorePanelContents() |
||||
{ |
||||
PropertyService.Set("SharpDevelop.LoadDocumentProperties", ((CheckBox)ControlDictionary[loadUserDataCheckBox]).Checked); |
||||
PropertyService.Set("SharpDevelop.LineTerminatorStyle", (LineTerminatorStyle)((ComboBox)ControlDictionary[lineTerminatorStyleComboBox]).SelectedIndex); |
||||
|
||||
FileChangeWatcher.DetectExternalChangesOption = detectExternalChangesCheckBox.Checked; |
||||
FileChangeWatcher.AutoLoadExternalChangesOption = autoLoadExternalChangesCheckBox.Checked; |
||||
FileService.DeleteToRecycleBin = useRecycleBinCheckBox.Checked; |
||||
FileService.SaveUsingTemporaryFile = ((CheckBox)ControlDictionary[createBackupCopyCheckBox]).Checked; |
||||
|
||||
return true; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue