Browse Source

Cleanup, remove unused Files

pull/30/head
PeterForstmeier 13 years ago
parent
commit
167b0fd2d9
  1. 5
      src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin
  2. 9
      src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj
  3. 61
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.cs
  4. 4
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.xaml
  5. 6
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.xaml.cs
  6. 26
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/StringListEditorDialogXaml.xaml
  7. 60
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/StringListEditorDialogXaml.xaml.cs
  8. 3
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  9. 241
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/old_ApplicationSettings.cs

5
src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin

@ -93,13 +93,10 @@ @@ -93,13 +93,10 @@
label = "${res:Dialog.ProjectOptions.BuildEvents}"
class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.BuildEvents"/>
<OptionPanel id = "BuildOptions"
label = "${res:Dialog.ProjectOptions.BuildOptions}"
class = "CSharpBinding.OptionPanels.BuildOptions"/>
<OptionPanel id = "BuildOptions1"
label = "${res:Dialog.ProjectOptions.BuildOptions}"
class = "CSharpBinding.OptionPanels.BuildOptionsXaml"/>
class = "CSharpBinding.OptionPanels.BuildOptions"/>
<OptionPanel id = "DebugOptions"
label = "${res:Dialog.ProjectOptions.DebugOptions}"

9
src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.csproj

@ -73,11 +73,8 @@ @@ -73,11 +73,8 @@
<Compile Include="Src\EventHandlerCompletionItemProvider.cs" />
<Compile Include="Src\FormattingStrategy\CSharpFormattingStrategy.cs" />
<Compile Include="Src\FormattingStrategy\DocumentAccessor.cs" />
<Compile Include="Src\OptionPanels\BuildOptions.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\OptionPanels\BuildOptionsXaml.xaml.cs">
<DependentUpon>BuildOptionsXaml.xaml</DependentUpon>
<Compile Include="Src\OptionPanels\BuildOptions.xaml.cs">
<DependentUpon>BuildOptions.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Src\OptionPanels\HexValidator.cs" />
@ -136,7 +133,7 @@ @@ -136,7 +133,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="Src\OptionPanels\BuildOptionsXaml.xaml" />
<Page Include="Src\OptionPanels\BuildOptions.xaml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

61
src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.cs

@ -1,61 +0,0 @@ @@ -1,61 +0,0 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
using ICSharpCode.SharpDevelop.Project;
using StringPair = System.Collections.Generic.KeyValuePair<System.String, System.String>;
namespace CSharpBinding.OptionPanels
{
public class BuildOptions : AbstractBuildOptions
{
public override void LoadPanelContents()
{
SetupFromXmlResource("BuildOptions.xfrm");
InitializeHelper();
InitBaseIntermediateOutputPath();
InitIntermediateOutputPath();
InitOutputPath();
InitXmlDoc();
InitTargetFramework();
ConfigurationGuiBinding b;
b = helper.BindString("conditionalSymbolsTextBox", "DefineConstants", TextBoxEditMode.EditRawProperty);
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
b.CreateLocationButton("conditionalSymbolsTextBox");
b = helper.BindBoolean("optimizeCodeCheckBox", "Optimize", false);
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
b.CreateLocationButton("optimizeCodeCheckBox");
b = helper.BindBoolean("allowUnsafeCodeCheckBox", "AllowUnsafeBlocks", false);
b.CreateLocationButton("allowUnsafeCodeCheckBox");
b = helper.BindBoolean("checkForOverflowCheckBox", "CheckForOverflowUnderflow", false);
b.DefaultLocation = PropertyStorageLocations.ConfigurationSpecific;
b.CreateLocationButton("checkForOverflowCheckBox");
b = helper.BindBoolean("noCorlibCheckBox", "NoStdLib", false);
b.CreateLocationButton("noCorlibCheckBox");
InitDebugInfo();
InitAdvanced();
b = helper.BindStringEnum("fileAlignmentComboBox", "FileAlignment",
"4096",
new StringPair("512", "512"),
new StringPair("1024", "1024"),
new StringPair("2048", "2048"),
new StringPair("4096", "4096"),
new StringPair("8192", "8192"));
b.DefaultLocation = PropertyStorageLocations.PlatformSpecific;
b.RegisterLocationButton(advancedLocationButton);
InitWarnings();
helper.AddConfigurationSelector(this);
}
}
}

4
src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptionsXaml.xaml → src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.xaml

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<optionpanels:ProjectOptionPanel
x:Class="CSharpBinding.OptionPanels.BuildOptionsXaml"
x:Class="CSharpBinding.OptionPanels.BuildOptions"
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"
@ -384,7 +384,7 @@ @@ -384,7 +384,7 @@
<ComboBox
x:Name="warningLevelComboBox"
Width="50"
Width="40"
Grid.Column="2"
HorizontalAlignment="Left"
ItemsSource="{Binding Path=DataContext.WarnLevel}"

6
src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptionsXaml.xaml.cs → src/AddIns/BackendBindings/CSharpBinding/Project/Src/OptionPanels/BuildOptions.xaml.cs

@ -31,7 +31,7 @@ namespace CSharpBinding.OptionPanels @@ -31,7 +31,7 @@ namespace CSharpBinding.OptionPanels
/// </summary>
/// SYST
public partial class BuildOptionsXaml : ProjectOptionPanel
public partial class BuildOptions : ProjectOptionPanel
{
private List<KeyItemPair> serializationInfo;
@ -46,7 +46,7 @@ namespace CSharpBinding.OptionPanels @@ -46,7 +46,7 @@ namespace CSharpBinding.OptionPanels
private MSBuildBasedProject project;
public BuildOptionsXaml()
public BuildOptions()
{
InitializeComponent();
this.serializationInfo = new List<KeyItemPair>();
@ -97,8 +97,6 @@ namespace CSharpBinding.OptionPanels @@ -97,8 +97,6 @@ namespace CSharpBinding.OptionPanels
this.Optimize.Location = PropertyStorageLocations.ConfigurationSpecific;
this.AllowUnsafeBlocks.Location = PropertyStorageLocations.ConfigurationSpecific;
this.CheckForOverflowUnderflow.Location = PropertyStorageLocations.ConfigurationSpecific;
//base.RaisePropertyChanged(string.Empty);
//IsDirty = false;
}
#region properties

26
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/StringListEditorDialogXaml.xaml

@ -1,26 +0,0 @@ @@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Window
x:Class="ICSharpCode.CppBinding.Project.StringListEditorDialogXaml" 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:widgets="http://icsharpcode.net/sharpdevelop/widgets"
xmlns:core="http://icsharpcode.net/sharpdevelop/core"
Width="400" Height="400"
Title="ICSharpCode.CppBinding.Project">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition Width="70"></ColumnDefinition>
<ColumnDefinition Width="70"></ColumnDefinition>
</Grid.ColumnDefinitions>
<gui:StringListEditorXaml x:Name="stringListEditor" Grid.ColumnSpan="3"></gui:StringListEditorXaml>
<Button Grid.Row="1" Grid.Column="1" IsCancel="True" Margin="5" Content="{core:Localize Global.CancelButtonText}"></Button>
<Button Grid.Row="1" Grid.Column="2" IsDefault="True" Margin="5" Click="Button_Click" Content="{core:Localize Global.OKButtonText}"></Button>
</Grid>
</Window>

60
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/StringListEditorDialogXaml.xaml.cs

@ -1,60 +0,0 @@ @@ -1,60 +0,0 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 15.04.2012
* Time: 18:35
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
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;
namespace ICSharpCode.CppBinding.Project
{
/// <summary>
/// Interaction logic for StringListEditorDialog.xaml
/// </summary>
public partial class StringListEditorDialogXaml : Window
{
public StringListEditorDialogXaml()
{
InitializeComponent();
}
public bool BrowseForDirectory {
get {return stringListEditor.BrowseForDirectory;}
set {stringListEditor.BrowseForDirectory = value;}
}
public string ListCaption {
get {return stringListEditor.ListCaption; }
set {stringListEditor.ListCaption = value;}
}
public string TitleText {
get {return stringListEditor.TitleText;}
set {stringListEditor.TitleText = value;}
}
public string[] GetList() {
return stringListEditor.GetList();
}
public void LoadList(IEnumerable<string> list) {
stringListEditor.LoadList(list);
}
void Button_Click(object sender, RoutedEventArgs e)
{
DialogResult = true;
}
}
}

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

@ -747,9 +747,6 @@ @@ -747,9 +747,6 @@
<Compile Include="Src\Services\Tasks\TaskEventHandler.cs" />
<Compile Include="Src\Gui\Pads\DefinitionViewPad.cs" />
<Compile Include="Src\Project\MSBuildEnums.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\old_ApplicationSettings.cs">
<SubType>UserControl</SubType>
</Compile>
<EmbeddedResource Include="Resources\ProjectOptions\old_ApplicationSettings.xfrm" />
<Compile Include="Src\Gui\Pads\PropertyPad\IDEContainer.cs" />
<Compile Include="Src\Gui\Pads\PropertyPad\PropertyContainer.cs" />

241
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/old_ApplicationSettings.cs

@ -1,241 +0,0 @@ @@ -1,241 +0,0 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
{
public class old_ApplicationSettings : AbstractXmlFormsProjectOptionPanel
{
ComboBox applicationManifestComboBox;
public override void LoadPanelContents()
{
SetupFromXmlResource("ProjectOptions.old_ApplicationSettings.xfrm");
InitializeHelper();
ConnectBrowseButton("applicationIconBrowseButton", "applicationIconTextBox",
"${res:SharpDevelop.FileFilter.Icons}|*.ico|${res:SharpDevelop.FileFilter.AllFiles}|*.*",
TextBoxEditMode.EditEvaluatedProperty);
ConnectBrowseButton("win32ResourceFileBrowseButton", "win32ResourceFileTextBox",
"Win32 Resource files|*.res|${res:SharpDevelop.FileFilter.AllFiles}|*.*",
TextBoxEditMode.EditEvaluatedProperty);
ConfigurationGuiBinding b;
ChooseStorageLocationButton locationButton;
b = helper.BindString("assemblyNameTextBox", "AssemblyName", TextBoxEditMode.EditEvaluatedProperty);
b.CreateLocationButton("assemblyNameTextBox");
Get<TextBox>("assemblyName").TextChanged += new EventHandler(RefreshOutputNameTextBox);
b = helper.BindString("rootNamespaceTextBox", "RootNamespace", TextBoxEditMode.EditEvaluatedProperty);
b.CreateLocationButton("rootNamespaceTextBox");
b = helper.BindEnum<OutputType>("outputTypeComboBox", "OutputType");
locationButton = b.CreateLocationButton("outputTypeComboBox");
Get<ComboBox>("outputType").SelectedIndexChanged += RefreshOutputNameTextBox;
Get<ComboBox>("outputType").SelectedIndexChanged += RefreshStartupObjectEnabled;
b = helper.BindString("startupObjectComboBox", "StartupObject", TextBoxEditMode.EditEvaluatedProperty);
b.RegisterLocationButton(locationButton);
foreach (IClass c in GetPossibleStartupObjects(project)) {
Get<ComboBox>("startupObject").Items.Add(c.FullyQualifiedName);
}
b = helper.BindString("applicationIconTextBox", "ApplicationIcon", TextBoxEditMode.EditEvaluatedProperty);
Get<TextBox>("applicationIcon").TextChanged += new EventHandler(ApplicationIconTextBoxTextChanged);
b.CreateLocationButton("applicationIconTextBox");
b = helper.BindString("win32ResourceFileTextBox", "Win32Resource", TextBoxEditMode.EditEvaluatedProperty);
b.CreateLocationButton("win32ResourceFileTextBox");
applicationManifestComboBox = Get<ComboBox>("applicationManifest");
applicationManifestComboBox.Items.Add(StringParser.Parse("${res:Dialog.ProjectOptions.ApplicationSettings.Manifest.EmbedDefault}"));
applicationManifestComboBox.Items.Add(StringParser.Parse("${res:Dialog.ProjectOptions.ApplicationSettings.Manifest.DoNotEmbedManifest}"));
foreach (string fileName in Directory.GetFiles(project.Directory, "*.manifest")) {
applicationManifestComboBox.Items.Add(Path.GetFileName(fileName));
}
applicationManifestComboBox.Items.Add(StringParser.Parse("<${res:Global.CreateButtonText}...>"));
applicationManifestComboBox.Items.Add(StringParser.Parse("<${res:Global.BrowseText}...>"));
applicationManifestComboBox.SelectedIndexChanged += ApplicationManifestComboBox_SelectedIndexChanged;
b = new ManifestBinding(applicationManifestComboBox);
helper.AddBinding("ApplicationManifest", b);
b.CreateLocationButton(applicationManifestComboBox);
applicationManifestComboBox.TextChanged += delegate { helper.IsDirty = true; };
// embedding manifests requires the project to target MSBuild 3.5 or higher
project_MinimumSolutionVersionChanged(null, null);
// re-evaluate if the project has the minimum version whenever this options page gets visible
// because the "convert project" button on the compiling tab page might have updated the MSBuild version.
project.MinimumSolutionVersionChanged += project_MinimumSolutionVersionChanged;
Get<TextBox>("projectFolder").Text = project.Directory;
Get<TextBox>("projectFile").Text = Path.GetFileName(project.FileName);
// maybe make this writable again? Needs special care when saving!
Get<TextBox>("projectFile").ReadOnly = true;
RefreshStartupObjectEnabled(null, EventArgs.Empty);
RefreshOutputNameTextBox(null, EventArgs.Empty);
helper.AddConfigurationSelector(this);
}
void project_MinimumSolutionVersionChanged(object sender, EventArgs e)
{
// embedding manifests requires the project to target MSBuild 3.5 or higher
applicationManifestComboBox.Enabled = project.MinimumSolutionVersion >= Solution.SolutionVersionVS2008;
}
protected override void Dispose(bool disposing)
{
project.MinimumSolutionVersionChanged -= project_MinimumSolutionVersionChanged;
base.Dispose(disposing);
}
void ApplicationManifestComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (applicationManifestComboBox.SelectedIndex == applicationManifestComboBox.Items.Count - 2) {
BeginInvoke(new MethodInvoker(CreateManifest));
} else if (applicationManifestComboBox.SelectedIndex == applicationManifestComboBox.Items.Count - 1) {
BeginInvoke(new MethodInvoker(BrowseForManifest));
}
}
void BrowseForManifest()
{
applicationManifestComboBox.SelectedIndex = -1;
BrowseForFile(applicationManifestComboBox, "${res:Dialog.ProjectOptions.ApplicationSettings.Manifest.ManifestFiles}|*.manifest|${res:SharpDevelop.FileFilter.AllFiles}|*.*", TextBoxEditMode.EditEvaluatedProperty);
}
void CreateManifest()
{
string manifestFile = Path.Combine(project.Directory, "app.manifest");
if (!File.Exists(manifestFile)) {
string defaultManifest;
using (Stream stream = typeof(ApplicationSettings).Assembly.GetManifestResourceStream("Resources.DefaultManifest.manifest")) {
if (stream == null)
throw new ResourceNotFoundException("DefaultManifest.manifest");
using (StreamReader r = new StreamReader(stream)) {
defaultManifest = r.ReadToEnd();
}
}
defaultManifest = defaultManifest.Replace("\t", EditorControlService.GlobalOptions.IndentationString);
File.WriteAllText(manifestFile, defaultManifest, System.Text.Encoding.UTF8);
FileService.FireFileCreated(manifestFile, false);
}
if (!project.IsFileInProject(manifestFile)) {
FileProjectItem newItem = new FileProjectItem(project, ItemType.None);
newItem.Include = "app.manifest";
ProjectService.AddProjectItem(project, newItem);
ProjectBrowserPad.RefreshViewAsync();
}
FileService.OpenFile(manifestFile);
applicationManifestComboBox.Text = "app.manifest";
}
//--------------
sealed class ManifestBinding : ConfigurationGuiBinding
{
ComboBox applicationManifestComboBox;
public ManifestBinding(ComboBox applicationManifestComboBox)
{
this.applicationManifestComboBox = applicationManifestComboBox;
}
public override void Load()
{
string manifestFileName = Get("");
if (string.IsNullOrEmpty(manifestFileName)) {
if (Helper.GetProperty("NoWin32Manifest", false, true)) {
// no manifest
applicationManifestComboBox.SelectedIndex = 1;
} else {
// default manifest
applicationManifestComboBox.SelectedIndex = 0;
}
} else {
applicationManifestComboBox.Text = manifestFileName;
}
}
public override bool Save()
{
if (applicationManifestComboBox.SelectedIndex == 0) {
// Embed default manifest
Set("");
Helper.SetProperty("NoWin32Manifest", "", true, this.Location);
} else if (applicationManifestComboBox.SelectedIndex == 1) {
// No manifest
Set("");
Helper.SetProperty("NoWin32Manifest", true, true, this.Location);
} else {
Set(applicationManifestComboBox.Text);
Helper.SetProperty("NoWin32Manifest", "", true, this.Location);
}
return true;
}
}
//--------------
public static IList<IClass> GetPossibleStartupObjects(IProject project)
{
List<IClass> results = new List<IClass>();
IProjectContent pc = ParserService.GetProjectContent(project);
if (pc != null) {
foreach (IClass c in pc.Classes) {
foreach (IMethod m in c.Methods) {
if (m.IsStatic && m.Name == "Main") {
results.Add(c);
}
}
}
}
return results;
}
void RefreshStartupObjectEnabled(object sender, EventArgs e)
{
bool isLibrary = OutputType.Library == (OutputType)Get<ComboBox>("outputType").SelectedIndex;
ControlDictionary["startupObjectComboBox"].Enabled = !isLibrary;
}
void RefreshOutputNameTextBox(object sender, EventArgs e)
{
Get<TextBox>("outputName").Text = Get<TextBox>("assemblyName").Text + CompilableProject.GetExtension((OutputType)Get<ComboBox>("outputType").SelectedIndex);
}
void ApplicationIconTextBoxTextChanged(object sender, EventArgs e)
{
if(FileUtility.IsValidPath(Get<TextBox>("applicationIcon").Text))
{
string applicationIcon = Path.Combine(baseDirectory, Get<TextBox>("applicationIcon").Text);
if (File.Exists(applicationIcon)) {
try {
Get<PictureBox>("applicationIcon").Image = Image.FromFile(applicationIcon);
} catch (OutOfMemoryException) {
Get<PictureBox>("applicationIcon").Image = null;
MessageService.ShowErrorFormatted("${res:Dialog.ProjectOptions.ApplicationSettings.InvalidIconFile}", FileUtility.NormalizePath(applicationIcon));
}
} else {
Get<PictureBox>("applicationIcon").Image = null;
}
}
}
}
}
Loading…
Cancel
Save