7 changed files with 428 additions and 1 deletions
@ -0,0 +1,173 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 05/02/2012 |
||||||
|
* Time: 19:54 |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.ComponentModel; |
||||||
|
using System.Linq; |
||||||
|
using System.Windows.Controls; |
||||||
|
using System.Windows.Input; |
||||||
|
|
||||||
|
using ICSharpCode.SharpDevelop; |
||||||
|
using ICSharpCode.SharpDevelop.Dom; |
||||||
|
using ICSharpCode.SharpDevelop.Editor; |
||||||
|
using ICSharpCode.SharpDevelop.Gui.OptionPanels; |
||||||
|
using ICSharpCode.SharpDevelop.Project; |
||||||
|
using ICSharpCode.SharpDevelop.Project.Converter; |
||||||
|
using ICSharpCode.SharpDevelop.Widgets; |
||||||
|
using StringPair = System.Collections.Generic.KeyValuePair<string, string>; |
||||||
|
|
||||||
|
|
||||||
|
namespace CSharpBinding.OptionPanels |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for BuildOptionsXaml.xaml
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
|
||||||
|
public partial class BuildOptionsXaml : ProjectOptionPanel |
||||||
|
{ |
||||||
|
// private List<StringPair> fileAlignment;
|
||||||
|
|
||||||
|
private ICommand updateProjectCommand; |
||||||
|
private ICommand changeOutputPath; |
||||||
|
private MSBuildBasedProject project; |
||||||
|
|
||||||
|
public BuildOptionsXaml() |
||||||
|
{ |
||||||
|
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() |
||||||
|
{ |
||||||
|
this.UpdateProjectCommand = new RelayCommand(UpdateProjectExecute); |
||||||
|
this.ChangeOutputPath = new RelayCommand(ChangeOutputPathExecute); |
||||||
|
UpdateTargetFrameworkCombo(); |
||||||
|
} |
||||||
|
#region properties
|
||||||
|
|
||||||
|
public ProjectProperty<string> DefineConstants { |
||||||
|
get {return GetProperty("DefineConstants", "", TextBoxEditMode.EditRawProperty); } |
||||||
|
} |
||||||
|
|
||||||
|
public ProjectProperty<string> Optimize { |
||||||
|
get {return GetProperty("Optimize", "", TextBoxEditMode.EditRawProperty); } |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public ProjectProperty<string> AllowUnsafeBlocks { |
||||||
|
get {return GetProperty("AllowUnsafeBlocks", "", TextBoxEditMode.EditRawProperty); } |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public ProjectProperty<string> CheckForOverflowUnderflow { |
||||||
|
get {return GetProperty("CheckForOverflowUnderflow", "", TextBoxEditMode.EditRawProperty); } |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public ProjectProperty<string> NoStdLib { |
||||||
|
get {return GetProperty("NoStdLib", "", TextBoxEditMode.EditRawProperty); } |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public ProjectProperty<string> OutputPath { |
||||||
|
get {return GetProperty("OutputPath", "", TextBoxEditMode.EditRawProperty); } |
||||||
|
} |
||||||
|
|
||||||
|
// Documentfile missing and only partial implemented
|
||||||
|
public ProjectProperty<string> DocumentationFile { |
||||||
|
get {return GetProperty("DocumentationFile", "", TextBoxEditMode.EditRawProperty);} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
public ProjectProperty<DebugSymbolType> DebugType { |
||||||
|
get {return GetProperty("DebugType",ICSharpCode.SharpDevelop.Project.DebugSymbolType.Full ); } |
||||||
|
} |
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region overrides
|
||||||
|
|
||||||
|
protected override void Load(MSBuildBasedProject project, string configuration, string platform) |
||||||
|
{ |
||||||
|
base.Load(project, configuration, platform); |
||||||
|
this.project = project; |
||||||
|
this.Initialize(); |
||||||
|
} |
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region Command Updateproject
|
||||||
|
|
||||||
|
public ICommand UpdateProjectCommand { |
||||||
|
get { return updateProjectCommand; } |
||||||
|
set { updateProjectCommand = value; |
||||||
|
base.RaisePropertyChanged(() =>this.UpdateProjectCommand); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
private void UpdateProjectExecute () |
||||||
|
{ |
||||||
|
UpgradeViewContent.Show(project.ParentSolution).Select(project as IUpgradableProject); |
||||||
|
this.UpdateTargetFrameworkCombo(); |
||||||
|
} |
||||||
|
|
||||||
|
private void UpdateTargetFrameworkCombo() |
||||||
|
{ |
||||||
|
TargetFramework fx = ((IUpgradableProject)project).CurrentTargetFramework; |
||||||
|
if (fx != null) { |
||||||
|
targetFrameworkComboBox.Items.Add(fx.DisplayName); |
||||||
|
targetFrameworkComboBox.SelectedIndex = 0; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ChangeOutputPathCommand
|
||||||
|
|
||||||
|
public ICommand ChangeOutputPath |
||||||
|
{ |
||||||
|
get {return this.changeOutputPath;} |
||||||
|
set {this.changeOutputPath = value; |
||||||
|
base.RaisePropertyChanged(() => this.ChangeOutputPath); |
||||||
|
} |
||||||
|
} |
||||||
|
private void ChangeOutputPathExecute() |
||||||
|
{ |
||||||
|
OutputPath.Value = base.BrowseForFolder("${res:Dialog.Options.PrjOptions.Configuration.FolderBrowserDescription}", |
||||||
|
base.BaseDirectory,outputPathTextBox.Text); |
||||||
|
base.RaisePropertyChanged(()=> OutputPath); |
||||||
|
} |
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
//Property DebugType
|
||||||
|
//void DebugSymbolsLoaded(object sender, EventArgs e)
|
||||||
|
|
||||||
|
#region FileAlignment
|
||||||
|
/* |
||||||
|
public List<KeyValuePair<string, string>> FileAlign { |
||||||
|
get { return fileAlignment; } |
||||||
|
set { fileAlignment = value; } |
||||||
|
} |
||||||
|
*/ |
||||||
|
#endregion
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,79 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 26.04.2012 |
||||||
|
* Time: 19:56 |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.ComponentModel; |
||||||
|
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.Widgets; |
||||||
|
|
||||||
|
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for SigningXaml.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class SigningXaml : ProjectOptionPanel |
||||||
|
{ |
||||||
|
// private const string KeyFileExtensions = "*.snk;*.pfx;*.key";
|
||||||
|
// private MSBuildBasedProject project;
|
||||||
|
|
||||||
|
public SigningXaml() |
||||||
|
{ |
||||||
|
InitializeComponent(); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
private void Initialize() |
||||||
|
{ |
||||||
|
Cmd = new RelayCommand<bool>(CheckExecute); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public ProjectProperty<String> SignAssembly { |
||||||
|
get { return GetProperty("SignAssembly","", TextBoxEditMode.EditEvaluatedProperty); } |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public ProjectProperty<string> AssemblyOriginatorKeyFile { |
||||||
|
get { return GetProperty("AssemblyOriginatorKeyFile","", TextBoxEditMode.EditEvaluatedProperty); } |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
#region overrides
|
||||||
|
|
||||||
|
protected override void Load(MSBuildBasedProject project, string configuration, string platform) |
||||||
|
{ |
||||||
|
base.Load(project, configuration, platform); |
||||||
|
Console.WriteLine("sign {0}",SignAssembly.Value.ToString()); |
||||||
|
//this.project = project;
|
||||||
|
Console.WriteLine("sign {0}",SignAssembly.Value.ToString()); |
||||||
|
Initialize(); |
||||||
|
string prop = GetProperty("SignAssembly", "", TextBoxEditMode.EditRawProperty).Value.ToString(); |
||||||
|
} |
||||||
|
#endregion
|
||||||
|
|
||||||
|
public RelayCommand<bool> Cmd {get;set;} |
||||||
|
|
||||||
|
|
||||||
|
private void CheckExecute(bool isChecked) |
||||||
|
{ |
||||||
|
Console.WriteLine(" Checkbox ischecked {0}",isChecked); |
||||||
|
IsDirty = true; |
||||||
|
SignAssembly.Value = "False"; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,36 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 05.05.2012 |
||||||
|
* Time: 19:29 |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
using System.Windows.Data; |
||||||
|
|
||||||
|
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of StringToBoolConverter.
|
||||||
|
/// </summary>
|
||||||
|
public class StringToBoolConverter:IValueConverter |
||||||
|
{ |
||||||
|
|
||||||
|
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
||||||
|
{ |
||||||
|
|
||||||
|
if ("True".Equals(value.ToString(),StringComparison.OrdinalIgnoreCase)) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
||||||
|
{ |
||||||
|
if ("True".Equals(value.ToString(),StringComparison.OrdinalIgnoreCase)) { |
||||||
|
return "True"; |
||||||
|
} |
||||||
|
return "False"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue