476 changed files with 27584 additions and 16671 deletions
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
@ -1,35 +0,0 @@
@@ -1,35 +0,0 @@
|
||||
<Components version="1.0"> |
||||
<System.Windows.Forms.UserControl> |
||||
<Name value="AnalysisIdeOptionPanel" /> |
||||
<ClientSize value="{Width=348, Height=301}" /> |
||||
<Controls> |
||||
<System.Windows.Forms.GroupBox> |
||||
<Name value="groupBox1" /> |
||||
<Location value="3, 3" /> |
||||
<Text value="${res:ICSharpCode.CodeAnalysis.IdeOptions.FxCopPath}" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<Size value="342, 117" /> |
||||
<TabIndex value="0" /> |
||||
<Controls> |
||||
<System.Windows.Forms.Button> |
||||
<Name value="findFxCopPathButton" /> |
||||
<Location value="92, 81" /> |
||||
<Text value="${res:ICSharpCode.CodeAnalysis.IdeOptions.FindFxCopPath}" /> |
||||
<Anchor value="Top" /> |
||||
<UseVisualStyleBackColor value="True" /> |
||||
<Size value="150, 23" /> |
||||
<TabIndex value="1" /> |
||||
</System.Windows.Forms.Button> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="statusLabel" /> |
||||
<Location value="6, 17" /> |
||||
<Text value="(showing current FxCop path)" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<Size value="330, 61" /> |
||||
<TabIndex value="0" /> |
||||
</System.Windows.Forms.Label> |
||||
</Controls> |
||||
</System.Windows.Forms.GroupBox> |
||||
</Controls> |
||||
</System.Windows.Forms.UserControl> |
||||
</Components> |
||||
@ -0,0 +1,82 @@
@@ -0,0 +1,82 @@
|
||||
<optionpanels:ProjectOptionPanel x:Class="ICSharpCode.CodeAnalysis.AnalysisProjectOptionsPanel" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
|
||||
xmlns:optionpanels="clr-namespace:ICSharpCode.SharpDevelop.Gui.OptionPanels;assembly=ICSharpCode.SharpDevelop" |
||||
xmlns:tv="http://icsharpcode.net/sharpdevelop/treeview" |
||||
xmlns:local="clr-namespace:ICSharpCode.CodeAnalysis" |
||||
xmlns:core="http://icsharpcode.net/sharpdevelop/core"> |
||||
<!-- xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui;assembly=ICSharpCode.SharpDevelop"--> |
||||
<Grid > |
||||
<Grid.RowDefinitions> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition></RowDefinition> |
||||
</Grid.RowDefinitions> |
||||
<Grid.ColumnDefinitions> |
||||
<ColumnDefinition Width="Auto"></ColumnDefinition> |
||||
<ColumnDefinition Width="30"></ColumnDefinition> |
||||
<ColumnDefinition></ColumnDefinition> |
||||
</Grid.ColumnDefinitions> |
||||
|
||||
<optionpanels:StorageLocationPicker Location="{Binding RunCodeAnalysis.Location}"></optionpanels:StorageLocationPicker> |
||||
|
||||
<CheckBox Grid.Column="1" VerticalAlignment="Center" Grid.ColumnSpan="2" |
||||
IsChecked="{Binding RunCodeAnalysis.Value}" |
||||
Content="{core:Localize ICSharpCode.CodeAnalysis.ProjectOptions.RunOnBuild}"></CheckBox> |
||||
|
||||
<Button Grid.Row="1" VerticalAlignment="Center" Grid.ColumnSpan="2" Margin="0,10,0,10" |
||||
Style="{x:Static core:GlobalStyles.ButtonStyle}" |
||||
Click="ChangeRuleAssembliesButtonClick" |
||||
Content="{core:Localize ICSharpCode.CodeAnalysis.ProjectOptions.AddRemoveRuleAssembly}"></Button> |
||||
|
||||
<tv:SharpTreeView x:Name="ruleTreeView" Grid.Row="2" Grid.ColumnSpan="3" |
||||
VerticalAlignment="Stretch" |
||||
ShowRoot="False" ShowLines="False" IsSynchronizedWithCurrentItem="True"> |
||||
<ListView.View> |
||||
<tv:SharpGridView > |
||||
<tv:SharpGridView.Columns> |
||||
<GridViewColumn Width="500" Header="ID"> |
||||
<GridViewColumn.CellTemplate> |
||||
<DataTemplate> |
||||
<tv:SharpTreeNodeView /> |
||||
</DataTemplate> |
||||
</GridViewColumn.CellTemplate> |
||||
</GridViewColumn> |
||||
|
||||
<GridViewColumn Header="Action"> |
||||
<GridViewColumn.CellTemplate> |
||||
<DataTemplate> |
||||
<StackPanel Orientation="Horizontal"> |
||||
<ComboBox Background="Transparent" Width="100" |
||||
HorizontalAlignment="Center" VerticalAlignment="Center" |
||||
ItemsSource="{Binding Path=RuleState}" |
||||
IsSynchronizedWithCurrentItem="True" |
||||
IsReadOnly="False" |
||||
SelectedIndex="{Binding Index}"> |
||||
|
||||
<ComboBox.ItemTemplate> |
||||
<DataTemplate> |
||||
<StackPanel Orientation="Horizontal"> |
||||
<Image VerticalAlignment="Center" Height="15" Margin="3,0,5,0" |
||||
Source="{Binding Item1}"></Image> |
||||
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding Item2}"></TextBlock> |
||||
|
||||
</StackPanel> |
||||
|
||||
</DataTemplate> |
||||
</ComboBox.ItemTemplate> |
||||
</ComboBox> |
||||
</StackPanel> |
||||
</DataTemplate> |
||||
</GridViewColumn.CellTemplate> |
||||
</GridViewColumn> |
||||
</tv:SharpGridView.Columns> |
||||
|
||||
</tv:SharpGridView> |
||||
</ListView.View> |
||||
</tv:SharpTreeView> |
||||
|
||||
</Grid> |
||||
</optionpanels:ProjectOptionPanel> |
||||
@ -1,87 +0,0 @@
@@ -1,87 +0,0 @@
|
||||
<optionpanels:ProjectOptionPanel x:Class="ICSharpCode.CodeAnalysis.AnalysisProjectOptionsPanelXaml" |
||||
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:optionpanels="clr-namespace:ICSharpCode.SharpDevelop.Gui.OptionPanels;assembly=ICSharpCode.SharpDevelop" |
||||
xmlns:project="clr-namespace:ICSharpCode.SharpDevelop.Project;assembly=ICSharpCode.SharpDevelop" |
||||
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets" |
||||
xmlns:tv="http://icsharpcode.net/sharpdevelop/treeview" |
||||
xmlns:local="clr-namespace:ICSharpCode.CodeAnalysis" |
||||
xmlns:core="http://icsharpcode.net/sharpdevelop/core"> |
||||
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto"> |
||||
<Grid > |
||||
<Grid.RowDefinitions> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition></RowDefinition> |
||||
<RowDefinition></RowDefinition> |
||||
</Grid.RowDefinitions> |
||||
<Grid.ColumnDefinitions> |
||||
<ColumnDefinition Width="Auto"></ColumnDefinition> |
||||
<ColumnDefinition Width="30"></ColumnDefinition> |
||||
<ColumnDefinition></ColumnDefinition> |
||||
</Grid.ColumnDefinitions> |
||||
|
||||
<optionpanels:StorageLocationPicker Location="{Binding RunCodeAnalysis.Location}"></optionpanels:StorageLocationPicker> |
||||
|
||||
<CheckBox Grid.Column="1" VerticalAlignment="Center" Grid.ColumnSpan="2" |
||||
IsChecked="{Binding RunCodeAnalysis.Value}" |
||||
Content="{core:Localize ICSharpCode.CodeAnalysis.ProjectOptions.RunOnBuild}"></CheckBox> |
||||
|
||||
<Button Grid.Row="1" VerticalAlignment="Center" Grid.ColumnSpan="2" Margin="0,10,0,10" |
||||
Style="{x:Static core:GlobalStyles.ButtonStyle}" |
||||
Click="ChangeRuleAssembliesButtonClick" |
||||
Content="{core:Localize ICSharpCode.CodeAnalysis.ProjectOptions.AddRemoveRuleAssembly}"></Button> |
||||
|
||||
<tv:SharpTreeView x:Name="ruleTreeView" ShowRoot="False" ShowLines="False" IsSynchronizedWithCurrentItem="True" |
||||
Grid.Row="2" Grid.ColumnSpan="3"> |
||||
|
||||
<ListView.View> |
||||
<tv:SharpGridView > |
||||
<tv:SharpGridView.Columns> |
||||
<GridViewColumn Width="500" Header="ID"> |
||||
<GridViewColumn.CellTemplate> |
||||
<DataTemplate> |
||||
<tv:SharpTreeNodeView /> |
||||
</DataTemplate> |
||||
</GridViewColumn.CellTemplate> |
||||
</GridViewColumn> |
||||
|
||||
<GridViewColumn Header="Action"> |
||||
<GridViewColumn.CellTemplate> |
||||
<DataTemplate> |
||||
<StackPanel Orientation="Horizontal"> |
||||
<ComboBox Background="Transparent" Width="100" |
||||
HorizontalAlignment="Center" VerticalAlignment="Center" |
||||
ItemsSource="{Binding Path=RuleState}" |
||||
IsSynchronizedWithCurrentItem="True" |
||||
IsReadOnly="False" |
||||
SelectedIndex="{Binding Index}"> |
||||
|
||||
<ComboBox.ItemTemplate> |
||||
<DataTemplate> |
||||
<StackPanel Orientation="Horizontal"> |
||||
<Image VerticalAlignment="Center" Height="15" Margin="3,0,5,0" |
||||
Source="{Binding Item1}"></Image> |
||||
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding Item2}"></TextBlock> |
||||
|
||||
</StackPanel> |
||||
|
||||
</DataTemplate> |
||||
</ComboBox.ItemTemplate> |
||||
</ComboBox> |
||||
</StackPanel> |
||||
</DataTemplate> |
||||
</GridViewColumn.CellTemplate> |
||||
</GridViewColumn> |
||||
</tv:SharpGridView.Columns> |
||||
|
||||
</tv:SharpGridView> |
||||
</ListView.View> |
||||
</tv:SharpTreeView> |
||||
|
||||
</Grid> |
||||
</ScrollViewer> |
||||
</optionpanels:ProjectOptionPanel> |
||||
@ -1,64 +0,0 @@
@@ -1,64 +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 ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Gui.OptionPanels; |
||||
using System; |
||||
using System.IO; |
||||
using System.Windows.Forms; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
|
||||
namespace ICSharpCode.CodeAnalysis |
||||
{ |
||||
/// <summary>
|
||||
/// Option panel to choose the FxCop path from.
|
||||
/// </summary>
|
||||
public class old_AnalysisIdeOptionsPanel : XmlFormsOptionPanel |
||||
{ |
||||
public override void LoadPanelContents() |
||||
{ |
||||
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("ICSharpCode.CodeAnalysis.Resources.AnalysisIdeOptionPanel.xfrm")); |
||||
|
||||
ShowStatus(); |
||||
Get<Button>("findFxCopPath").Click += FindFxCopPathClick; |
||||
} |
||||
|
||||
void ShowStatus() |
||||
{ |
||||
string path = FxCopWrapper.FindFxCopPath(); |
||||
if (path == null) { |
||||
Get<Label>("status").Text = StringParser.Parse("${res:ICSharpCode.CodeAnalysis.IdeOptions.FxCopNotFound}"); |
||||
} else { |
||||
Get<Label>("status").Text = StringParser.Parse("${res:ICSharpCode.CodeAnalysis.IdeOptions.FxCopFoundInPath}") |
||||
+ Environment.NewLine + path; |
||||
} |
||||
} |
||||
|
||||
void FindFxCopPathClick(object sender, EventArgs e) |
||||
{ |
||||
using (OpenFileDialog dlg = new OpenFileDialog()) { |
||||
dlg.DefaultExt = "exe"; |
||||
dlg.Filter = StringParser.Parse("FxCop|fxcop.exe|${res:SharpDevelop.FileFilter.AllFiles}|*.*"); |
||||
if (dlg.ShowDialog() == DialogResult.OK) { |
||||
string path = Path.GetDirectoryName(dlg.FileName); |
||||
if (FxCopWrapper.IsFxCopPath(path)) { |
||||
FxCopPath = path; |
||||
} else { |
||||
MessageService.ShowError("${res:ICSharpCode.CodeAnalysis.IdeOptions.DirectoryDoesNotContainFxCop}"); |
||||
} |
||||
} |
||||
} |
||||
ShowStatus(); |
||||
} |
||||
|
||||
public static string FxCopPath { |
||||
get { |
||||
return SD.PropertyService.Get("CodeAnalysis.FxCopPath", string.Empty); |
||||
} |
||||
set { |
||||
SD.PropertyService.Set("CodeAnalysis.FxCopPath", value); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -1,166 +0,0 @@
@@ -1,166 +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)
|
||||
|
||||
namespace ICSharpCode.CodeAnalysis |
||||
{ |
||||
partial class old_AnalysisProjectOptions : System.Windows.Forms.UserControl |
||||
{ |
||||
/// <summary>
|
||||
/// Designer variable used to keep track of non-visual components.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null; |
||||
|
||||
/// <summary>
|
||||
/// Disposes resources used by the control.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing) { |
||||
if (components != null) { |
||||
components.Dispose(); |
||||
} |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() |
||||
{ |
||||
System.Windows.Forms.SplitContainer splitContainer1; |
||||
System.Windows.Forms.Panel panel1; |
||||
this.ruleLabel = new System.Windows.Forms.Label(); |
||||
this.warningOrErrorLabel = new System.Windows.Forms.Label(); |
||||
this.enableCheckBox = new System.Windows.Forms.CheckBox(); |
||||
this.ruleTreeView = new System.Windows.Forms.TreeView(); |
||||
this.changeRuleAssembliesButton = new System.Windows.Forms.Button(); |
||||
splitContainer1 = new System.Windows.Forms.SplitContainer(); |
||||
panel1 = new System.Windows.Forms.Panel(); |
||||
splitContainer1.Panel1.SuspendLayout(); |
||||
splitContainer1.Panel2.SuspendLayout(); |
||||
splitContainer1.SuspendLayout(); |
||||
panel1.SuspendLayout(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
splitContainer1.BackColor = System.Drawing.SystemColors.ControlDark; |
||||
splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; |
||||
splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; |
||||
splitContainer1.Location = new System.Drawing.Point(1, 1); |
||||
splitContainer1.Name = "splitContainer1"; |
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
splitContainer1.Panel1.Controls.Add(this.ruleLabel); |
||||
splitContainer1.Panel1.RightToLeft = System.Windows.Forms.RightToLeft.No; |
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
splitContainer1.Panel2.Controls.Add(this.warningOrErrorLabel); |
||||
splitContainer1.Panel2.RightToLeft = System.Windows.Forms.RightToLeft.No; |
||||
splitContainer1.RightToLeft = System.Windows.Forms.RightToLeft.No; |
||||
splitContainer1.Size = new System.Drawing.Size(375, 17); |
||||
splitContainer1.SplitterDistance = 214; |
||||
splitContainer1.SplitterWidth = 2; |
||||
splitContainer1.TabIndex = 1; |
||||
//
|
||||
// ruleLabel
|
||||
//
|
||||
this.ruleLabel.BackColor = System.Drawing.SystemColors.ControlLight; |
||||
this.ruleLabel.Dock = System.Windows.Forms.DockStyle.Fill; |
||||
this.ruleLabel.Location = new System.Drawing.Point(0, 0); |
||||
this.ruleLabel.Name = "ruleLabel"; |
||||
this.ruleLabel.Size = new System.Drawing.Size(214, 17); |
||||
this.ruleLabel.TabIndex = 0; |
||||
this.ruleLabel.Text = "${res:ICSharpCode.CodeAnalysis.Rule}"; |
||||
//
|
||||
// warningOrErrorLabel
|
||||
//
|
||||
this.warningOrErrorLabel.BackColor = System.Drawing.SystemColors.ControlLight; |
||||
this.warningOrErrorLabel.Dock = System.Windows.Forms.DockStyle.Fill; |
||||
this.warningOrErrorLabel.Location = new System.Drawing.Point(0, 0); |
||||
this.warningOrErrorLabel.Name = "warningOrErrorLabel"; |
||||
this.warningOrErrorLabel.Size = new System.Drawing.Size(159, 17); |
||||
this.warningOrErrorLabel.TabIndex = 0; |
||||
this.warningOrErrorLabel.Text = "${res:ICSharpCode.CodeAnalysis.ProjectOptions.WarningOrError}"; |
||||
//
|
||||
// panel1
|
||||
//
|
||||
panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
panel1.BackColor = System.Drawing.SystemColors.InactiveCaption; |
||||
panel1.Controls.Add(splitContainer1); |
||||
panel1.Location = new System.Drawing.Point(15, 57); |
||||
panel1.Name = "panel1"; |
||||
panel1.Padding = new System.Windows.Forms.Padding(1); |
||||
panel1.Size = new System.Drawing.Size(377, 19); |
||||
panel1.TabIndex = 3; |
||||
//
|
||||
// enableCheckBox
|
||||
//
|
||||
this.enableCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.enableCheckBox.Location = new System.Drawing.Point(15, 4); |
||||
this.enableCheckBox.Name = "enableCheckBox"; |
||||
this.enableCheckBox.Size = new System.Drawing.Size(376, 24); |
||||
this.enableCheckBox.TabIndex = 0; |
||||
this.enableCheckBox.Text = "${res:ICSharpCode.CodeAnalysis.ProjectOptions.RunOnBuild}"; |
||||
this.enableCheckBox.UseVisualStyleBackColor = true; |
||||
//
|
||||
// ruleTreeView
|
||||
//
|
||||
this.ruleTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) |
||||
| System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.ruleTreeView.CheckBoxes = true; |
||||
this.ruleTreeView.DrawMode = System.Windows.Forms.TreeViewDrawMode.OwnerDrawText; |
||||
this.ruleTreeView.Location = new System.Drawing.Point(15, 75); |
||||
this.ruleTreeView.Name = "ruleTreeView"; |
||||
this.ruleTreeView.RightToLeft = System.Windows.Forms.RightToLeft.No; |
||||
this.ruleTreeView.Size = new System.Drawing.Size(377, 166); |
||||
this.ruleTreeView.TabIndex = 2; |
||||
this.ruleTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.RuleTreeViewAfterCheck); |
||||
this.ruleTreeView.DrawNode += new System.Windows.Forms.DrawTreeNodeEventHandler(this.RuleTreeViewDrawNode); |
||||
this.ruleTreeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.RuleTreeViewMouseDown); |
||||
//
|
||||
// changeRuleAssembliesButton
|
||||
//
|
||||
this.changeRuleAssembliesButton.AutoSize = true; |
||||
this.changeRuleAssembliesButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; |
||||
this.changeRuleAssembliesButton.Location = new System.Drawing.Point(15, 28); |
||||
this.changeRuleAssembliesButton.Name = "changeRuleAssembliesButton"; |
||||
this.changeRuleAssembliesButton.Size = new System.Drawing.Size(387, 23); |
||||
this.changeRuleAssembliesButton.TabIndex = 4; |
||||
this.changeRuleAssembliesButton.Text = "${res:ICSharpCode.CodeAnalysis.ProjectOptions.AddRemoveRuleAssembly}"; |
||||
this.changeRuleAssembliesButton.UseVisualStyleBackColor = true; |
||||
this.changeRuleAssembliesButton.Click += new System.EventHandler(this.ChangeRuleAssembliesButtonClick); |
||||
//
|
||||
// AnalysisProjectOptions
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
||||
this.Controls.Add(this.changeRuleAssembliesButton); |
||||
this.Controls.Add(this.ruleTreeView); |
||||
this.Controls.Add(this.enableCheckBox); |
||||
this.Controls.Add(panel1); |
||||
this.Name = "AnalysisProjectOptions"; |
||||
this.Size = new System.Drawing.Size(395, 244); |
||||
splitContainer1.Panel1.ResumeLayout(false); |
||||
splitContainer1.Panel2.ResumeLayout(false); |
||||
splitContainer1.ResumeLayout(false); |
||||
panel1.ResumeLayout(false); |
||||
this.ResumeLayout(false); |
||||
this.PerformLayout(); |
||||
} |
||||
private System.Windows.Forms.Button changeRuleAssembliesButton; |
||||
private System.Windows.Forms.Label warningOrErrorLabel; |
||||
private System.Windows.Forms.TreeView ruleTreeView; |
||||
private System.Windows.Forms.Label ruleLabel; |
||||
private System.Windows.Forms.CheckBox enableCheckBox; |
||||
} |
||||
} |
||||
@ -1,450 +0,0 @@
@@ -1,450 +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.Text; |
||||
using System.Text.RegularExpressions; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
|
||||
namespace ICSharpCode.CodeAnalysis |
||||
{ |
||||
public partial class old_AnalysisProjectOptions |
||||
{ |
||||
Dictionary<string, RuleTreeNode> rules = new Dictionary<string, RuleTreeNode>(); |
||||
|
||||
public old_AnalysisProjectOptions() |
||||
{ |
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
InitializeComponent(); |
||||
|
||||
enableCheckBox.Text = StringParser.Parse(enableCheckBox.Text); |
||||
ruleLabel.Text = StringParser.Parse(ruleLabel.Text); |
||||
warningOrErrorLabel.Text = StringParser.Parse(warningOrErrorLabel.Text); |
||||
changeRuleAssembliesButton.Text = StringParser.Parse(changeRuleAssembliesButton.Text); |
||||
|
||||
ruleLabel.SizeChanged += delegate { ruleTreeView.Invalidate(); }; |
||||
} |
||||
|
||||
bool initSuccess; |
||||
|
||||
protected override void OnVisibleChanged(EventArgs e) |
||||
{ |
||||
base.OnVisibleChanged(e); |
||||
|
||||
if (ruleTreeView.Nodes.Count == 0 && this.Visible) { |
||||
ReloadRuleList(); |
||||
} |
||||
} |
||||
|
||||
void ReloadRuleList() |
||||
{ |
||||
ruleTreeView.Nodes.Clear(); |
||||
FxCopWrapper.GetRuleList(GetRuleAssemblyList(true), Callback); |
||||
if (ruleTreeView.Nodes.Count == 0) { |
||||
ruleTreeView.Nodes.Add(StringParser.Parse("${res:ICSharpCode.CodeAnalysis.ProjectOptions.LoadingRules}")); |
||||
} |
||||
} |
||||
|
||||
void Callback(List<FxCopCategory> ruleList) |
||||
{ |
||||
if (WorkbenchSingleton.InvokeRequired) { |
||||
WorkbenchSingleton.SafeThreadAsyncCall((Action<List<FxCopCategory>>)Callback, ruleList); |
||||
} else { |
||||
ruleTreeView.Nodes.Clear(); |
||||
rules.Clear(); |
||||
if (ruleList == null || ruleList.Count == 0) { |
||||
ruleTreeView.Nodes.Add(new TreeNode(StringParser.Parse("${res:ICSharpCode.CodeAnalysis.ProjectOptions.CannotFindFxCop}"))); |
||||
ruleTreeView.Nodes.Add(new TreeNode(StringParser.Parse("${res:ICSharpCode.CodeAnalysis.ProjectOptions.SpecifyFxCopPath}"))); |
||||
} else { |
||||
foreach (FxCopCategory cat in ruleList) { |
||||
CategoryTreeNode catNode = new CategoryTreeNode(cat); |
||||
ruleTreeView.Nodes.Add(catNode); |
||||
foreach (RuleTreeNode ruleNode in catNode.Nodes) { |
||||
rules[ruleNode.Identifier] = ruleNode; |
||||
} |
||||
} |
||||
initSuccess = true; |
||||
ReadRuleString(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
#region TreeView drawing
|
||||
class CategoryTreeNode : TreeNode |
||||
{ |
||||
internal FxCopCategory category; |
||||
|
||||
public CategoryTreeNode(FxCopCategory category) |
||||
{ |
||||
this.category = category; |
||||
this.Text = category.DisplayName; |
||||
foreach (FxCopRule rule in category.Rules) { |
||||
this.Nodes.Add(new RuleTreeNode(rule)); |
||||
} |
||||
} |
||||
|
||||
internal int ErrorState { |
||||
get { |
||||
bool allWarn = true; |
||||
bool allErr = true; |
||||
foreach (RuleTreeNode tn in Nodes) { |
||||
if (tn.isError) |
||||
allWarn = false; |
||||
else |
||||
allErr = false; |
||||
} |
||||
if (allErr) |
||||
return 1; |
||||
else if (allWarn) |
||||
return 0; |
||||
else |
||||
return -1; |
||||
} |
||||
} |
||||
} |
||||
|
||||
class RuleTreeNode : TreeNode |
||||
{ |
||||
internal FxCopRule rule; |
||||
internal bool isError; |
||||
|
||||
public RuleTreeNode(FxCopRule rule) |
||||
{ |
||||
this.rule = rule; |
||||
this.Text = rule.CheckId + " : " + rule.DisplayName; |
||||
} |
||||
|
||||
public string Identifier { |
||||
get { |
||||
return rule.CategoryName + "#" + rule.CheckId; |
||||
} |
||||
} |
||||
} |
||||
|
||||
void RuleTreeViewDrawNode(object sender, DrawTreeNodeEventArgs e) |
||||
{ |
||||
if (e.Bounds.X < 5) return; |
||||
int state; |
||||
if (e.Node is CategoryTreeNode) { |
||||
state = (e.Node as CategoryTreeNode).ErrorState; |
||||
} else if (e.Node is RuleTreeNode) { |
||||
state = (e.Node as RuleTreeNode).isError ? 1 : 0; |
||||
} else { |
||||
e.DrawDefault = true; |
||||
return; |
||||
} |
||||
e.DrawDefault = false; |
||||
if ((e.State & TreeNodeStates.Selected) == TreeNodeStates.Selected) { |
||||
e.Graphics.DrawString(e.Node.Text, ruleTreeView.Font, SystemBrushes.HighlightText, e.Bounds.Location); |
||||
} else { |
||||
e.Graphics.DrawString(e.Node.Text, ruleTreeView.Font, SystemBrushes.WindowText, e.Bounds.Location); |
||||
} |
||||
e.Graphics.DrawLine(SystemPens.WindowFrame, ruleLabel.Width, e.Bounds.Top, ruleLabel.Width, e.Bounds.Bottom); |
||||
if (state == 0) { |
||||
// Warning
|
||||
e.Graphics.DrawIcon(SystemIcons.Warning, new Rectangle(ruleLabel.Width + 4, e.Bounds.Y, 16, 16)); |
||||
e.Graphics.DrawString(ResourceService.GetString("Global.WarningText"), ruleTreeView.Font, SystemBrushes.WindowText, ruleLabel.Width + 24, e.Bounds.Y); |
||||
} else if (state == 1) { |
||||
// Error
|
||||
e.Graphics.DrawIcon(SystemIcons.Error, new Rectangle(ruleLabel.Width + 4, e.Bounds.Y, 16, 16)); |
||||
e.Graphics.DrawString(ResourceService.GetString("Global.ErrorText"), ruleTreeView.Font, SystemBrushes.WindowText, ruleLabel.Width + 24, e.Bounds.Y); |
||||
} else { |
||||
// Mixed
|
||||
e.Graphics.DrawString(StringParser.Parse("${res:ICSharpCode.CodeAnalysis.ProjectOptions.WarningErrorMixed}"), |
||||
ruleTreeView.Font, SystemBrushes.WindowText, ruleLabel.Width + 24, e.Bounds.Y); |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
#region Rule String Property
|
||||
string CreateRuleString() |
||||
{ |
||||
StringBuilder b = new StringBuilder(); |
||||
foreach (TreeNode category in ruleTreeView.Nodes) { |
||||
foreach (RuleTreeNode rule in category.Nodes) { |
||||
if (!rule.Checked || rule.isError) { |
||||
if (b.Length > 0) |
||||
b.Append(';'); |
||||
if (rule.Checked) |
||||
b.Append('+'); |
||||
else |
||||
b.Append('-'); |
||||
if (rule.isError) |
||||
b.Append('!'); |
||||
b.Append(rule.Identifier); |
||||
} |
||||
} |
||||
} |
||||
return b.ToString(); |
||||
} |
||||
|
||||
void ReadRuleString() |
||||
{ |
||||
userCheck = false; |
||||
foreach (TreeNode cat in ruleTreeView.Nodes) { |
||||
foreach (RuleTreeNode rtn in cat.Nodes) { |
||||
rtn.Checked = true; |
||||
rtn.isError = false; |
||||
} |
||||
} |
||||
foreach (string rule2 in ruleString.Split(';')) { |
||||
string rule = rule2; |
||||
if (rule.Length == 0) continue; |
||||
bool active = true; |
||||
bool error = false; |
||||
if (rule.StartsWith("-")) { |
||||
active = false; |
||||
rule = rule.Substring(1); |
||||
} else if (rule.StartsWith("+")) { |
||||
rule = rule.Substring(1); |
||||
} |
||||
if (rule.StartsWith("!")) { |
||||
error = true; |
||||
rule = rule.Substring(1); |
||||
} |
||||
RuleTreeNode ruleNode; |
||||
if (rules.TryGetValue(rule, out ruleNode)) { |
||||
ruleNode.Checked = active; |
||||
ruleNode.isError = error; |
||||
} |
||||
} |
||||
foreach (TreeNode cat in ruleTreeView.Nodes) { |
||||
bool noneChecked = true; |
||||
foreach (RuleTreeNode rtn in cat.Nodes) { |
||||
if (rtn.Checked) { |
||||
noneChecked = false; |
||||
break; |
||||
} |
||||
} |
||||
cat.Checked = !noneChecked; |
||||
} |
||||
ruleTreeView.Invalidate(); |
||||
userCheck = true; |
||||
} |
||||
|
||||
string ruleString = ""; |
||||
|
||||
public string RuleString { |
||||
get { |
||||
if (initSuccess) |
||||
return CreateRuleString(); |
||||
else |
||||
return ruleString; |
||||
} |
||||
set { |
||||
ruleString = value; |
||||
if (initSuccess) { |
||||
ReadRuleString(); |
||||
} |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
#region Rule Assemblies Property
|
||||
string ruleAssemblies; |
||||
const string DefaultRuleAssemblies = @"$(FxCopDir)\rules"; |
||||
|
||||
public string RuleAssemblies { |
||||
get { |
||||
return ruleAssemblies; |
||||
} |
||||
set { |
||||
if (string.IsNullOrEmpty(value)) { |
||||
value = DefaultRuleAssemblies; |
||||
} |
||||
if (ruleAssemblies != value) { |
||||
ruleAssemblies = value; |
||||
|
||||
if (initSuccess) { |
||||
OnOptionChanged(EventArgs.Empty); |
||||
ReloadRuleList(); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
#region ConfigurationGuiBinding
|
||||
public CheckBox EnableCheckBox { |
||||
get { |
||||
return enableCheckBox; |
||||
} |
||||
} |
||||
|
||||
public ConfigurationGuiBinding CreateBinding() |
||||
{ |
||||
return new ConfigBinding(this); |
||||
} |
||||
|
||||
class ConfigBinding : ConfigurationGuiBinding |
||||
{ |
||||
readonly old_AnalysisProjectOptions po; |
||||
|
||||
public ConfigBinding(old_AnalysisProjectOptions po) |
||||
{ |
||||
this.po = po; |
||||
this.TreatPropertyValueAsLiteral = false; |
||||
po.OptionChanged += delegate { |
||||
Helper.IsDirty = true; |
||||
}; |
||||
} |
||||
|
||||
public override void Load() |
||||
{ |
||||
po.RuleString = Get(""); |
||||
po.RuleAssemblies = Helper.GetProperty("CodeAnalysisRuleAssemblies", "", false); |
||||
} |
||||
|
||||
public override bool Save() |
||||
{ |
||||
Set(po.RuleString); |
||||
Helper.SetProperty("CodeAnalysisRuleAssemblies", |
||||
(po.RuleAssemblies == DefaultRuleAssemblies) ? "" : po.RuleAssemblies, |
||||
false, |
||||
Location); |
||||
return true; |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
public event EventHandler OptionChanged; |
||||
|
||||
protected virtual void OnOptionChanged(EventArgs e) |
||||
{ |
||||
if (OptionChanged != null) { |
||||
OptionChanged(this, e); |
||||
} |
||||
} |
||||
|
||||
void RuleTreeViewMouseDown(object sender, MouseEventArgs e) |
||||
{ |
||||
if (e.Button == MouseButtons.Left && e.X > ruleLabel.Width) { |
||||
TreeNode node = ruleTreeView.GetNodeAt(20, e.Y); |
||||
if (node != null) { |
||||
if (node is RuleTreeNode) { |
||||
((RuleTreeNode)node).isError = !((RuleTreeNode)node).isError; |
||||
} else if (node is CategoryTreeNode) { |
||||
if ((node as CategoryTreeNode).ErrorState == 0) { |
||||
foreach (RuleTreeNode rtn in node.Nodes) { |
||||
rtn.isError = true; |
||||
} |
||||
} else { |
||||
foreach (RuleTreeNode rtn in node.Nodes) { |
||||
rtn.isError = false; |
||||
} |
||||
} |
||||
} |
||||
ruleTreeView.Invalidate(); |
||||
OnOptionChanged(EventArgs.Empty); |
||||
} |
||||
} |
||||
} |
||||
|
||||
bool userCheck; |
||||
|
||||
void RuleTreeViewAfterCheck(object sender, TreeViewEventArgs e) |
||||
{ |
||||
if (userCheck) { |
||||
if (e.Node is CategoryTreeNode) { |
||||
userCheck = false; |
||||
foreach (TreeNode subNode in e.Node.Nodes) { |
||||
subNode.Checked = e.Node.Checked; |
||||
} |
||||
userCheck = true; |
||||
} else if (e.Node is RuleTreeNode) { |
||||
userCheck = false; |
||||
bool anyChecked = false; |
||||
foreach (TreeNode sibling in e.Node.Parent.Nodes) { |
||||
if (sibling.Checked) |
||||
anyChecked = true; |
||||
} |
||||
e.Node.Parent.Checked = anyChecked; |
||||
userCheck = true; |
||||
} |
||||
OnOptionChanged(EventArgs.Empty); |
||||
} |
||||
} |
||||
|
||||
string[] GetRuleAssemblyList(bool replacePath) |
||||
{ |
||||
List<string> list = new List<string>(); |
||||
string fxCopPath = FxCopWrapper.FindFxCopPath(); |
||||
foreach (string dir in ruleAssemblies.Split(';')) { |
||||
if (string.Equals(dir, "$(FxCopDir)\\rules", StringComparison.OrdinalIgnoreCase)) |
||||
continue; |
||||
if (string.Equals(dir, "$(FxCopDir)/rules", StringComparison.OrdinalIgnoreCase)) |
||||
continue; |
||||
if (replacePath && !string.IsNullOrEmpty(fxCopPath)) { |
||||
list.Add(Regex.Replace(dir, @"\$\(FxCopDir\)", fxCopPath, RegexOptions.CultureInvariant | RegexOptions.IgnoreCase)); |
||||
} else { |
||||
list.Add(dir); |
||||
} |
||||
} |
||||
return list.ToArray(); |
||||
} |
||||
|
||||
void ChangeRuleAssembliesButtonClick(object sender, EventArgs e) |
||||
{ |
||||
using (Form frm = new Form()) { |
||||
frm.Text = changeRuleAssembliesButton.Text; |
||||
|
||||
StringListEditor ed = new StringListEditor(); |
||||
ed.Dock = DockStyle.Fill; |
||||
ed.ManualOrder = false; |
||||
ed.BrowseForDirectory = true; |
||||
ed.AutoAddAfterBrowse = true; |
||||
ed.TitleText = StringParser.Parse("${res:ICSharpCode.CodeAnalysis.ProjectOptions.ChooseRuleAssemblyDirectory}"); |
||||
|
||||
ed.LoadList(GetRuleAssemblyList(false)); |
||||
FlowLayoutPanel p = new FlowLayoutPanel(); |
||||
p.Dock = DockStyle.Bottom; |
||||
p.FlowDirection = FlowDirection.RightToLeft; |
||||
|
||||
Button btn = new Button(); |
||||
p.Height = btn.Height + 8; |
||||
btn.DialogResult = DialogResult.Cancel; |
||||
btn.Text = ResourceService.GetString("Global.CancelButtonText"); |
||||
frm.CancelButton = btn; |
||||
p.Controls.Add(btn); |
||||
|
||||
btn = new Button(); |
||||
btn.DialogResult = DialogResult.OK; |
||||
btn.Text = ResourceService.GetString("Global.OKButtonText"); |
||||
frm.AcceptButton = btn; |
||||
p.Controls.Add(btn); |
||||
|
||||
frm.Controls.Add(ed); |
||||
frm.Controls.Add(p); |
||||
|
||||
frm.FormBorderStyle = FormBorderStyle.FixedDialog; |
||||
frm.MaximizeBox = false; |
||||
frm.MinimizeBox = false; |
||||
frm.ClientSize = new Size(400, 300); |
||||
frm.StartPosition = FormStartPosition.CenterParent; |
||||
|
||||
if (frm.ShowDialog(FindForm()) == DialogResult.OK) { |
||||
StringBuilder b = new StringBuilder(DefaultRuleAssemblies); |
||||
foreach (string asm in ed.GetList()) { |
||||
b.Append(';'); |
||||
b.Append(asm); |
||||
} |
||||
bool oldInitSuccess = initSuccess; |
||||
initSuccess = true; |
||||
try { |
||||
this.RuleAssemblies = b.ToString(); |
||||
} finally { |
||||
initSuccess = oldInitSuccess; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -1,32 +0,0 @@
@@ -1,32 +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.Windows.Forms; |
||||
using ICSharpCode.SharpDevelop.Gui.OptionPanels; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
|
||||
namespace ICSharpCode.CodeAnalysis |
||||
{ |
||||
public class AnalysisProjectOptionsPanel : AbstractXmlFormsProjectOptionPanel |
||||
{ |
||||
public override void LoadPanelContents() |
||||
{ |
||||
InitializeHelper(); |
||||
|
||||
old_AnalysisProjectOptions po = new old_AnalysisProjectOptions(); |
||||
po.Dock = DockStyle.Fill; |
||||
Controls.Add(po); |
||||
|
||||
ChooseStorageLocationButton btn; |
||||
btn = helper.BindBoolean(po.EnableCheckBox, "RunCodeAnalysis", false).CreateLocationButton(po.EnableCheckBox); |
||||
ConfigurationGuiBinding binding = po.CreateBinding(); |
||||
binding.RegisterLocationButton(btn); |
||||
helper.AddBinding("CodeAnalysisRules", binding); |
||||
|
||||
Control ctl = helper.CreateConfigurationSelector(); |
||||
ctl.Dock = DockStyle.Top; |
||||
Controls.Add(ctl); |
||||
} |
||||
} |
||||
} |
||||
@ -1,106 +0,0 @@
@@ -1,106 +0,0 @@
|
||||
<Components version="1.0"> |
||||
<System.Windows.Forms.UserControl> |
||||
<Name value="CodeCoverageOptionsPanel" /> |
||||
<ClientSize value="{Width=351, Height=281}" /> |
||||
<Controls> |
||||
<System.Windows.Forms.GroupBox> |
||||
<Name value="codeCoverageColoursGroupBox" /> |
||||
<Location value="10, 13" /> |
||||
<UseCompatibleTextRendering value="True" /> |
||||
<Text value="${res:ICSharpCode.CodeCoverage.OptionsPanel.CodeCoverageColoursGroupBoxText}" /> |
||||
<Size value="333, 159" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="1" /> |
||||
<Controls> |
||||
<ICSharpCode.CodeCoverage.ColorPickerComboBox> |
||||
<Name value="backgroundColorPickerComboBox" /> |
||||
<TabIndex value="6" /> |
||||
<DrawMode value="OwnerDrawFixed" /> |
||||
<Location value="177, 91" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<MinimumSize value="116, 21" /> |
||||
<Size value="116, 21" /> |
||||
<FormattingEnabled value="True" /> |
||||
<DropDownStyle value="DropDownList" /> |
||||
<SelectedColor value="Color [Black]" /> |
||||
</ICSharpCode.CodeCoverage.ColorPickerComboBox> |
||||
<ICSharpCode.CodeCoverage.ColorPickerComboBox> |
||||
<Name value="foregroundColorPickerComboBox" /> |
||||
<TabIndex value="3" /> |
||||
<DrawMode value="OwnerDrawFixed" /> |
||||
<Location value="179, 44" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<Size value="116, 21" /> |
||||
<MinimumSize value="116, 21" /> |
||||
<FormattingEnabled value="True" /> |
||||
<DropDownStyle value="DropDownList" /> |
||||
<SelectedColor value="Color [Black]" /> |
||||
</ICSharpCode.CodeCoverage.ColorPickerComboBox> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="sampleTextLabel" /> |
||||
<Location value="6, 117" /> |
||||
<UseCompatibleTextRendering value="True" /> |
||||
<Text value="${res:ICSharpCode.CodeCoverage.OptionsPanel.SampleText}" /> |
||||
<Size value="321, 39" /> |
||||
<TextAlign value="MiddleCenter" /> |
||||
<Anchor value="Top, Bottom, Left, Right" /> |
||||
<TabIndex value="8" /> |
||||
</System.Windows.Forms.Label> |
||||
<System.Windows.Forms.ListBox> |
||||
<Name value="displayItemsListBox" /> |
||||
<TabIndex value="1" /> |
||||
<Location value="6, 44" /> |
||||
<Size value="164, 69" /> |
||||
<FormattingEnabled value="True" /> |
||||
</System.Windows.Forms.ListBox> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="displayItemsLabel" /> |
||||
<Location value="6, 29" /> |
||||
<UseCompatibleTextRendering value="True" /> |
||||
<Text value="${res:ICSharpCode.CodeCoverage.OptionsPanel.DisplayItemsLabel}" /> |
||||
<Size value="107, 21" /> |
||||
<TabIndex value="0" /> |
||||
</System.Windows.Forms.Label> |
||||
<System.Windows.Forms.Button> |
||||
<Name value="backgroundCustomColourButton" /> |
||||
<Location value="299, 91" /> |
||||
<UseCompatibleTextRendering value="True" /> |
||||
<Text value="..." /> |
||||
<UseVisualStyleBackColor value="True" /> |
||||
<Size value="28, 22" /> |
||||
<Anchor value="Top, Right" /> |
||||
<TabIndex value="7" /> |
||||
</System.Windows.Forms.Button> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="itemBackgroundColourLabel" /> |
||||
<Location value="176, 73" /> |
||||
<UseCompatibleTextRendering value="True" /> |
||||
<Text value="${res:ICSharpCode.CodeCoverage.OptionsPanel.ItemBackgroundLabel}" /> |
||||
<Size value="151, 21" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="5" /> |
||||
</System.Windows.Forms.Label> |
||||
<System.Windows.Forms.Button> |
||||
<Name value="foregroundCustomColourButton" /> |
||||
<Location value="299, 44" /> |
||||
<UseCompatibleTextRendering value="True" /> |
||||
<Text value="..." /> |
||||
<UseVisualStyleBackColor value="True" /> |
||||
<Size value="28, 22" /> |
||||
<Anchor value="Top, Right" /> |
||||
<TabIndex value="4" /> |
||||
</System.Windows.Forms.Button> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="itemForegroundColourLabel" /> |
||||
<Location value="176, 29" /> |
||||
<UseCompatibleTextRendering value="True" /> |
||||
<Text value="${res:ICSharpCode.CodeCoverage.OptionsPanel.ItemForegroundLabel}" /> |
||||
<Size value="151, 22" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="2" /> |
||||
</System.Windows.Forms.Label> |
||||
</Controls> |
||||
</System.Windows.Forms.GroupBox> |
||||
</Controls> |
||||
</System.Windows.Forms.UserControl> |
||||
</Components> |
||||
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
// 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.IO; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
|
||||
namespace ICSharpCode.CodeCoverage |
||||
{ |
||||
public class ProjectCodeCoverageResultsFileName |
||||
{ |
||||
public ProjectCodeCoverageResultsFileName(IProject project) |
||||
{ |
||||
FileName = GetCodeCoverageResultsFileName(project); |
||||
} |
||||
|
||||
public string FileName { get; private set; } |
||||
|
||||
string GetCodeCoverageResultsFileName(IProject project) |
||||
{ |
||||
string outputDirectory = GetOutputDirectory(project); |
||||
return Path.Combine(outputDirectory, "coverage.xml"); |
||||
} |
||||
|
||||
string GetOutputDirectory(IProject project) |
||||
{ |
||||
return Path.Combine(project.Directory, "OpenCover"); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
// 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.IO; |
||||
|
||||
using ICSharpCode.SharpDevelop.Project; |
||||
|
||||
namespace ICSharpCode.CodeCoverage |
||||
{ |
||||
public class SolutionCodeCoverageResults |
||||
{ |
||||
Solution solution; |
||||
IFileSystem fileSystem; |
||||
|
||||
public SolutionCodeCoverageResults(Solution solution) |
||||
: this(solution, new FileSystem()) |
||||
{ |
||||
} |
||||
|
||||
public SolutionCodeCoverageResults(Solution solution, IFileSystem fileSystem) |
||||
{ |
||||
this.solution = solution; |
||||
this.fileSystem = fileSystem; |
||||
} |
||||
|
||||
public IEnumerable<CodeCoverageResults> GetCodeCoverageResultsForAllProjects() |
||||
{ |
||||
foreach (IProject project in solution.Projects) { |
||||
CodeCoverageResults results = GetCodeCoverageResultsForProject(project); |
||||
if (results != null) { |
||||
yield return results; |
||||
} |
||||
} |
||||
} |
||||
|
||||
CodeCoverageResults GetCodeCoverageResultsForProject(IProject project) |
||||
{ |
||||
var fileName = new ProjectCodeCoverageResultsFileName(project); |
||||
if (fileSystem.FileExists(fileName.FileName)) { |
||||
TextReader reader = fileSystem.CreateTextReader(fileName.FileName); |
||||
return new CodeCoverageResults(reader); |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
} |
||||
@ -1,112 +0,0 @@
@@ -1,112 +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 ICSharpCode.SharpDevelop.Gui.OptionPanels; |
||||
using System; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
|
||||
namespace ICSharpCode.CodeCoverage |
||||
{ |
||||
public class old_CodeCoverageOptionsPanel : XmlFormsOptionPanel |
||||
{ |
||||
static readonly string foregroundCustomColourButtonName = "foregroundCustomColourButton"; |
||||
static readonly string backgroundCustomColourButtonName = "backgroundCustomColourButton"; |
||||
static readonly string foregroundColourComboBoxName = "foregroundColorPickerComboBox"; |
||||
static readonly string backgroundColourComboBoxName = "backgroundColorPickerComboBox"; |
||||
static readonly string displayItemsListBoxName = "displayItemsListBox"; |
||||
static readonly string sampleTextLabelName = "sampleTextLabel"; |
||||
|
||||
ColorPickerComboBox foregroundColorPickerComboBox; |
||||
ColorPickerComboBox backgroundColorPickerComboBox; |
||||
ListBox displayItemsListBox; |
||||
Label sampleTextLabel; |
||||
|
||||
public override void LoadPanelContents() |
||||
{ |
||||
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("ICSharpCode.CodeCoverage.Resources.CodeCoverageOptionsPanel.xfrm")); |
||||
|
||||
ControlDictionary[foregroundCustomColourButtonName].Click += ForegroundCustomColourButtonClick; |
||||
ControlDictionary[backgroundCustomColourButtonName].Click += BackgroundCustomColourButtonClick; |
||||
|
||||
foregroundColorPickerComboBox = (ColorPickerComboBox)ControlDictionary[foregroundColourComboBoxName]; |
||||
foregroundColorPickerComboBox.SelectedIndexChanged += ForegroundColorPickerComboBoxSelectedIndexChanged; |
||||
|
||||
backgroundColorPickerComboBox = (ColorPickerComboBox)ControlDictionary[backgroundColourComboBoxName]; |
||||
backgroundColorPickerComboBox.SelectedIndexChanged += BackgroundColorPickerComboBoxSelectedIndexChanged; |
||||
|
||||
sampleTextLabel = (Label)ControlDictionary[sampleTextLabelName]; |
||||
|
||||
displayItemsListBox = (ListBox)ControlDictionary[displayItemsListBoxName]; |
||||
displayItemsListBox.Items.Add(new CodeCoverageDisplayItem(StringParser.Parse("${res:ICSharpCode.CodeCoverage.CodeCovered}"), CodeCoverageOptions.VisitedColorProperty, CodeCoverageOptions.VisitedColor, CodeCoverageOptions.VisitedForeColorProperty, CodeCoverageOptions.VisitedForeColor)); |
||||
displayItemsListBox.Items.Add(new CodeCoverageDisplayItem(StringParser.Parse("${res:ICSharpCode.CodeCoverage.CodeNotCovered}"), CodeCoverageOptions.NotVisitedColorProperty, CodeCoverageOptions.NotVisitedColor, CodeCoverageOptions.NotVisitedForeColorProperty, CodeCoverageOptions.NotVisitedForeColor)); |
||||
displayItemsListBox.SelectedIndexChanged += DisplayItemsListBoxSelectedIndexChanged; |
||||
displayItemsListBox.SelectedIndex = 0; |
||||
} |
||||
|
||||
public override bool StorePanelContents() |
||||
{ |
||||
bool codeCoverageColorsChanged = false; |
||||
|
||||
foreach (CodeCoverageDisplayItem item in displayItemsListBox.Items) { |
||||
CodeCoverageOptions.Properties.Set<Color>(item.ForeColorPropertyName, item.ForeColor); |
||||
CodeCoverageOptions.Properties.Set<Color>(item.BackColorPropertyName, item.BackColor); |
||||
if (item.HasChanged) { |
||||
codeCoverageColorsChanged = true; |
||||
} |
||||
} |
||||
|
||||
if (codeCoverageColorsChanged) { |
||||
CodeCoverageService.RefreshCodeCoverageHighlights(); |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
void ForegroundCustomColourButtonClick(object sender, EventArgs e) |
||||
{ |
||||
SelectCustomColour(foregroundColorPickerComboBox); |
||||
} |
||||
|
||||
void BackgroundCustomColourButtonClick(object sender, EventArgs e) |
||||
{ |
||||
SelectCustomColour(backgroundColorPickerComboBox); |
||||
} |
||||
|
||||
void SelectCustomColour(ColorPickerComboBox comboBox) |
||||
{ |
||||
using (SharpDevelopColorDialog colorDialog = new SharpDevelopColorDialog()) { |
||||
colorDialog.FullOpen = true; |
||||
colorDialog.Color = comboBox.SelectedColor; |
||||
if (colorDialog.ShowDialog() == DialogResult.OK) { |
||||
comboBox.SelectedColor = colorDialog.Color; |
||||
} |
||||
} |
||||
} |
||||
|
||||
void DisplayItemsListBoxSelectedIndexChanged(object sender, EventArgs e) |
||||
{ |
||||
CodeCoverageDisplayItem item = (CodeCoverageDisplayItem)displayItemsListBox.SelectedItem; |
||||
sampleTextLabel.BackColor = item.BackColor; |
||||
sampleTextLabel.ForeColor = item.ForeColor; |
||||
foregroundColorPickerComboBox.SelectedColor = item.ForeColor; |
||||
backgroundColorPickerComboBox.SelectedColor = item.BackColor; |
||||
} |
||||
|
||||
void ForegroundColorPickerComboBoxSelectedIndexChanged(object sender, EventArgs e) |
||||
{ |
||||
CodeCoverageDisplayItem item = (CodeCoverageDisplayItem)displayItemsListBox.SelectedItem; |
||||
sampleTextLabel.ForeColor = foregroundColorPickerComboBox.SelectedColor; |
||||
item.ForeColor = foregroundColorPickerComboBox.SelectedColor; |
||||
} |
||||
|
||||
void BackgroundColorPickerComboBoxSelectedIndexChanged(object sender, EventArgs e) |
||||
{ |
||||
CodeCoverageDisplayItem item = (CodeCoverageDisplayItem)displayItemsListBox.SelectedItem; |
||||
sampleTextLabel.BackColor = backgroundColorPickerComboBox.SelectedColor; |
||||
item.BackColor = backgroundColorPickerComboBox.SelectedColor; |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,89 @@
@@ -0,0 +1,89 @@
|
||||
// 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.IO; |
||||
using System.Linq; |
||||
|
||||
using ICSharpCode.CodeCoverage.Tests.Utils; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using NUnit.Framework; |
||||
using Rhino.Mocks; |
||||
using UnitTesting.Tests.Utils; |
||||
|
||||
namespace ICSharpCode.CodeCoverage.Tests.Coverage |
||||
{ |
||||
[TestFixture] |
||||
public class SolutionCodeCoverageResultsTests |
||||
{ |
||||
SolutionCodeCoverageResults solutionCodeCoverageResults; |
||||
Solution solution; |
||||
IFileSystem fakeFileSystem; |
||||
|
||||
void CreateSolutionCodeCoverageResults() |
||||
{ |
||||
solution = new Solution(new MockProjectChangeWatcher()); |
||||
fakeFileSystem = MockRepository.GenerateStub<IFileSystem>(); |
||||
solutionCodeCoverageResults = new SolutionCodeCoverageResults(solution, fakeFileSystem); |
||||
} |
||||
|
||||
IEnumerable<CodeCoverageResults> GetCodeCoverageResultsForAllProjects() |
||||
{ |
||||
return solutionCodeCoverageResults.GetCodeCoverageResultsForAllProjects(); |
||||
} |
||||
|
||||
void AddProject(string fileName) |
||||
{ |
||||
var project = new MockCSharpProject(solution, Path.GetFileNameWithoutExtension(fileName)); |
||||
project.FileName = fileName; |
||||
solution.Folders.Add(project); |
||||
} |
||||
|
||||
void AddCodeCoverageFile(string fileName) |
||||
{ |
||||
string coverageXml = "<CodeCoverage></CodeCoverage>"; |
||||
AddCodeCoverageFile(fileName, coverageXml); |
||||
} |
||||
|
||||
void AddCodeCoverageFile(string fileName, string coverageXml) |
||||
{ |
||||
var stringReader = new StringReader(coverageXml); |
||||
fakeFileSystem.Stub(fs => fs.FileExists(fileName)).Return(true); |
||||
fakeFileSystem.Stub(fs => fs.CreateTextReader(fileName)).Return(stringReader); |
||||
} |
||||
|
||||
[Test] |
||||
public void GetCodeCoverageResultsForAllProjects_NoProjects_ReturnsNoResults() |
||||
{ |
||||
CreateSolutionCodeCoverageResults(); |
||||
|
||||
List<CodeCoverageResults> results = GetCodeCoverageResultsForAllProjects().ToList(); |
||||
|
||||
Assert.AreEqual(0, results.Count); |
||||
} |
||||
|
||||
[Test] |
||||
public void GetCodeCoverageResultsForAllProjects_OneProject_ReturnsOneCodeCoverageResult() |
||||
{ |
||||
CreateSolutionCodeCoverageResults(); |
||||
AddProject(@"d:\Projects\MyProject\MyProject.csproj"); |
||||
AddCodeCoverageFile(@"d:\Projects\MyProject\OpenCover\coverage.xml"); |
||||
|
||||
List<CodeCoverageResults> results = GetCodeCoverageResultsForAllProjects().ToList(); |
||||
|
||||
Assert.AreEqual(1, results.Count); |
||||
} |
||||
|
||||
[Test] |
||||
public void GetCodeCoverageResultsForAllProjects_OneProjectInSolutionWithoutCodeCoverageResultsFile_ReturnsNoResults() |
||||
{ |
||||
CreateSolutionCodeCoverageResults(); |
||||
AddProject(@"d:\Projects\MyProject\MyProject.csproj"); |
||||
|
||||
List<CodeCoverageResults> results = GetCodeCoverageResultsForAllProjects().ToList(); |
||||
|
||||
Assert.AreEqual(0, results.Count); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,89 @@
@@ -0,0 +1,89 @@
|
||||
// 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.Linq; |
||||
using NUnit.Framework; |
||||
|
||||
namespace ICSharpCode.CodeCoverage.Tests.Coverage |
||||
{ |
||||
/// <summary>
|
||||
/// Code coverage results when two classes have similar names that match
|
||||
/// at the start:
|
||||
///
|
||||
/// FooResult
|
||||
/// FooResultParser
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class TwoClassNamesMatchingAtStartTests : CodeCoverageResultsTestsBase |
||||
{ |
||||
[TestFixtureSetUp] |
||||
public void SetUpFixture() |
||||
{ |
||||
string xml = |
||||
"<CoverageSession xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n" + |
||||
" <Modules>\r\n" + |
||||
" <Module hash=\"44-54-B6-13-97-49-45-F8-6A-74-9E-49-0C-77-87-C6-9C-54-47-7A\">\r\n" + |
||||
" <FullName>C:\\Projects\\Test\\Foo\\bin\\Foo.DLL</FullName>\r\n" + |
||||
" <ModuleName>Foo.Tests</ModuleName>\r\n" + |
||||
" <Files>\r\n" + |
||||
" <File uid=\"1\" fullPath=\"c:\\Projects\\Foo\\FooResults.cs\" />\r\n" + |
||||
" <File uid=\"2\" fullPath=\"c:\\Projects\\Foo\\FooResultsParser.cs\" />\r\n" + |
||||
" </Files>\r\n" + |
||||
" <Classes>\r\n" + |
||||
" <Class>\r\n" + |
||||
" <FullName>Foo.Results</FullName>\r\n" + |
||||
" <Methods>\r\n" + |
||||
" <Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\r\n" + |
||||
" <MetadataToken>100663297</MetadataToken>\r\n" + |
||||
" <Name>System.String Foo.Results::GetResult()</Name>\r\n" + |
||||
" <FileRef uid=\"2\" />\r\n" + |
||||
" <SequencePoints>\r\n" + |
||||
" <SequencePoint vc=\"1\" sl=\"20\" sc=\"3\" el=\"20\" ec=\"4\" />\r\n" + |
||||
" </SequencePoints>\r\n" + |
||||
" </Method>\r\n" + |
||||
" </Methods>\r\n" + |
||||
" </Class>\r\n" + |
||||
" <Class>\r\n" + |
||||
" <FullName>Foo.ResultsParser</FullName>\r\n" + |
||||
" <Methods>\r\n" + |
||||
" <Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\r\n" + |
||||
" <MetadataToken>100663297</MetadataToken>\r\n" + |
||||
" <Name>System.Void Foo.ResultsParser::Parse()</Name>\r\n" + |
||||
" <FileRef uid=\"2\" />\r\n" + |
||||
" <SequencePoints>\r\n" + |
||||
" <SequencePoint vc=\"1\" sl=\"20\" sc=\"3\" el=\"20\" ec=\"4\" />\r\n" + |
||||
" </SequencePoints>\r\n" + |
||||
" </Method>\r\n" + |
||||
" </Methods>\r\n" + |
||||
" </Class>\r\n" + |
||||
" </Classes>\r\n" + |
||||
" </Module>\r\n" + |
||||
" </Modules>\r\n" + |
||||
"</CoverageSession>"; |
||||
|
||||
base.CreateCodeCoverageResults(xml); |
||||
} |
||||
|
||||
[Test] |
||||
public void ResultsClass_Methods_HasOneMethodCalledResults() |
||||
{ |
||||
List<CodeCoverageMethod> methods = |
||||
FirstModule.Methods.Where(m => m.ClassName == "Results").ToList(); |
||||
|
||||
Assert.AreEqual("GetResult", methods[0].Name); |
||||
Assert.AreEqual(1, methods.Count); |
||||
} |
||||
|
||||
[Test] |
||||
public void ResultsParserClass_Methods_HasOneMethodCalledParse() |
||||
{ |
||||
List<CodeCoverageMethod> methods = |
||||
FirstModule.Methods.Where(m => m.ClassName == "ResultsParser").ToList(); |
||||
|
||||
Assert.AreEqual("Parse", methods[0].Name); |
||||
Assert.AreEqual(1, methods.Count); |
||||
} |
||||
} |
||||
} |
||||
@ -1,43 +0,0 @@
@@ -1,43 +0,0 @@
|
||||
<Components version="1.0"> |
||||
<System.Windows.Forms.UserControl> |
||||
<Name value="AnalysisIdeOptionPanel" /> |
||||
<ClientSize value="{Width=348, Height=301}" /> |
||||
<Controls> |
||||
<System.Windows.Forms.Button> |
||||
<Name value="ModifyStyleCopSettingsButton" /> |
||||
<Location value="77, 169" /> |
||||
<Text value="Modify Master StyleCop Settings" /> |
||||
<UseVisualStyleBackColor value="True" /> |
||||
<Size value="187, 23" /> |
||||
<TabIndex value="1" /> |
||||
</System.Windows.Forms.Button> |
||||
<System.Windows.Forms.GroupBox> |
||||
<Name value="groupBox1" /> |
||||
<Location value="3, 3" /> |
||||
<Text value="StyleCop Path" /> |
||||
<Size value="342, 117" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="0" /> |
||||
<Controls> |
||||
<System.Windows.Forms.Button> |
||||
<Name value="FindStyleCopPathButton" /> |
||||
<Location value="92, 81" /> |
||||
<Text value="Find StyleCop path" /> |
||||
<UseVisualStyleBackColor value="True" /> |
||||
<Size value="150, 23" /> |
||||
<Anchor value="Top" /> |
||||
<TabIndex value="1" /> |
||||
</System.Windows.Forms.Button> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="statusLabel" /> |
||||
<Location value="6, 17" /> |
||||
<Text value="(showing current FxCop path)" /> |
||||
<Size value="330, 61" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="0" /> |
||||
</System.Windows.Forms.Label> |
||||
</Controls> |
||||
</System.Windows.Forms.GroupBox> |
||||
</Controls> |
||||
</System.Windows.Forms.UserControl> |
||||
</Components> |
||||
@ -1,86 +0,0 @@
@@ -1,86 +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 ICSharpCode.SharpDevelop.Gui.OptionPanels; |
||||
using System; |
||||
using System.Diagnostics; |
||||
using System.IO; |
||||
using System.Windows.Forms; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
|
||||
namespace ICSharpCode.SourceAnalysis |
||||
{ |
||||
/// <summary>
|
||||
/// Option panel to choose the StyleCop path from.
|
||||
/// </summary>
|
||||
|
||||
public class old_AnalysisIdeOptionsPanel : XmlFormsOptionPanel |
||||
{ |
||||
public override void LoadPanelContents() |
||||
{ |
||||
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("ICSharpCode.SourceAnalysis.Resources.old_AnalysisIdeOptionPanel.xfrm")); |
||||
|
||||
ShowStatus(); |
||||
Get<Button>("FindStyleCopPath").Click += FindStyleCopPathClick; |
||||
Get<Button>("ModifyStyleCopSettings").Click += ModifyStyleCopSettingsClick; |
||||
} |
||||
|
||||
void ShowStatus() |
||||
{ |
||||
string path = StyleCopWrapper.FindStyleCopPath(); |
||||
if (path == null) { |
||||
Get<Label>("status").Text = StringParser.Parse("StyleCop not found in the given path."); |
||||
Get<Button>("ModifyStyleCopSettings").Enabled = false; |
||||
} else { |
||||
Get<Label>("status").Text = StringParser.Parse("StyleCop was found in: ") |
||||
+ Environment.NewLine + path; |
||||
Get<Button>("ModifyStyleCopSettings").Enabled = true; |
||||
} |
||||
} |
||||
|
||||
void FindStyleCopPathClick(object sender, EventArgs e) |
||||
{ |
||||
using (OpenFileDialog dlg = new OpenFileDialog()) { |
||||
dlg.DefaultExt = "dll"; |
||||
dlg.Filter = StringParser.Parse("StyleCop|*" + StyleCopWrapper.STYLE_COP_FILE + "|${res:SharpDevelop.FileFilter.AllFiles}|*.*"); |
||||
if (dlg.ShowDialog() == DialogResult.OK) { |
||||
string path = dlg.FileName; |
||||
if (StyleCopWrapper.IsStyleCopPath(path)) { |
||||
StyleCopPath = path; |
||||
} else { |
||||
MessageService.ShowError(string.Format("Directory does not contain StyleCop (*{0}).", StyleCopWrapper.STYLE_COP_FILE)); |
||||
} |
||||
} |
||||
} |
||||
ShowStatus(); |
||||
} |
||||
|
||||
void ModifyStyleCopSettingsClick(object sender, EventArgs e) |
||||
{ |
||||
var executable = Path.Combine(Path.GetDirectoryName(StyleCopWrapper.FindStyleCopPath()), "StyleCopSettingsEditor.exe"); |
||||
var parameters = "\"" + StyleCopWrapper.GetMasterSettingsFile() + "\""; |
||||
|
||||
if (!File.Exists(executable)) { |
||||
LoggingService.Debug("StyleCopSettingsEditor.exe: " + executable); |
||||
MessageService.ShowWarning("Unable to find the StyleCop Settings editor. Please specify the StyleCop location in Tools Options."); |
||||
return; |
||||
} |
||||
|
||||
using(Process p = Process.Start("\"" + executable + "\"", parameters)) |
||||
{ |
||||
// No need to wait for the settings dialog to close - we can leave it open.
|
||||
} |
||||
} |
||||
|
||||
public static string StyleCopPath { |
||||
get { |
||||
return PropertyService.Get("SourceAnalysis.StyleCopPath"); |
||||
} |
||||
set { |
||||
PropertyService.Set("SourceAnalysis.StyleCopPath", value); |
||||
} |
||||
} |
||||
} |
||||
|
||||
} |
||||
@ -1,104 +0,0 @@
@@ -1,104 +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)
|
||||
|
||||
namespace ICSharpCode.SourceAnalysis |
||||
{ |
||||
partial class AnalysisProjectOptions : System.Windows.Forms.UserControl |
||||
{ |
||||
/// <summary>
|
||||
/// Designer variable used to keep track of non-visual components.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null; |
||||
|
||||
/// <summary>
|
||||
/// Disposes resources used by the control.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing) { |
||||
if (components != null) { |
||||
components.Dispose(); |
||||
} |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() |
||||
{ |
||||
this.enableCheckBox = new System.Windows.Forms.CheckBox(); |
||||
this.modifyStyleCopSettingsButton = new System.Windows.Forms.Button(); |
||||
this.browseButton = new System.Windows.Forms.Button(); |
||||
this.settingsFileTextBox = new System.Windows.Forms.TextBox(); |
||||
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// enableCheckBox
|
||||
//
|
||||
this.enableCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.enableCheckBox.Location = new System.Drawing.Point(15, 4); |
||||
this.enableCheckBox.Name = "enableCheckBox"; |
||||
this.enableCheckBox.Size = new System.Drawing.Size(376, 24); |
||||
this.enableCheckBox.TabIndex = 0; |
||||
this.enableCheckBox.Text = "Run source analysis when compiling"; |
||||
this.enableCheckBox.UseVisualStyleBackColor = true; |
||||
//
|
||||
// modifyStyleCopSettingsButton
|
||||
//
|
||||
this.modifyStyleCopSettingsButton.Location = new System.Drawing.Point(15, 60); |
||||
this.modifyStyleCopSettingsButton.Name = "modifyStyleCopSettingsButton"; |
||||
this.modifyStyleCopSettingsButton.Size = new System.Drawing.Size(150, 23); |
||||
this.modifyStyleCopSettingsButton.TabIndex = 2; |
||||
this.modifyStyleCopSettingsButton.Text = "Modify StyleCop Settings"; |
||||
this.modifyStyleCopSettingsButton.UseVisualStyleBackColor = true; |
||||
//
|
||||
// browseButton
|
||||
//
|
||||
this.browseButton.Location = new System.Drawing.Point(349, 31); |
||||
this.browseButton.Name = "browseButton"; |
||||
this.browseButton.Size = new System.Drawing.Size(42, 23); |
||||
this.browseButton.TabIndex = 3; |
||||
this.browseButton.Text = "..."; |
||||
this.browseButton.UseVisualStyleBackColor = true; |
||||
this.browseButton.Click += new System.EventHandler(this.BrowseButtonClick); |
||||
//
|
||||
// settingsFileTextBox
|
||||
//
|
||||
this.settingsFileTextBox.Location = new System.Drawing.Point(15, 34); |
||||
this.settingsFileTextBox.Name = "settingsFileTextBox"; |
||||
this.settingsFileTextBox.Size = new System.Drawing.Size(328, 20); |
||||
this.settingsFileTextBox.TabIndex = 4; |
||||
//
|
||||
// openFileDialog1
|
||||
//
|
||||
this.openFileDialog1.DefaultExt = "SourceAnalysis"; |
||||
this.openFileDialog1.FileName = "openFileDialog1"; |
||||
this.openFileDialog1.Filter = "SourceAnalysis files|*.SourceAnalysis|All files|*.*"; |
||||
this.openFileDialog1.Title = "Select settings file"; |
||||
//
|
||||
// AnalysisProjectOptions
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
||||
this.Controls.Add(this.settingsFileTextBox); |
||||
this.Controls.Add(this.browseButton); |
||||
this.Controls.Add(this.modifyStyleCopSettingsButton); |
||||
this.Controls.Add(this.enableCheckBox); |
||||
this.Name = "AnalysisProjectOptions"; |
||||
this.Size = new System.Drawing.Size(395, 244); |
||||
this.ResumeLayout(false); |
||||
this.PerformLayout(); |
||||
} |
||||
private System.Windows.Forms.OpenFileDialog openFileDialog1; |
||||
private System.Windows.Forms.Button modifyStyleCopSettingsButton; |
||||
private System.Windows.Forms.Button browseButton; |
||||
private System.Windows.Forms.TextBox settingsFileTextBox; |
||||
private System.Windows.Forms.CheckBox enableCheckBox; |
||||
} |
||||
} |
||||
@ -1,98 +0,0 @@
@@ -1,98 +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.Text; |
||||
using System.Text.RegularExpressions; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
|
||||
namespace ICSharpCode.SourceAnalysis |
||||
{ |
||||
public partial class AnalysisProjectOptions |
||||
{ |
||||
public AnalysisProjectOptions() |
||||
{ |
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
InitializeComponent(); |
||||
|
||||
enableCheckBox.Text = StringParser.Parse(enableCheckBox.Text); |
||||
} |
||||
|
||||
#region ConfigurationGuiBinding
|
||||
public CheckBox EnableCheckBox { |
||||
get { |
||||
return enableCheckBox; |
||||
} |
||||
} |
||||
|
||||
public TextBox SettingsFileTextBox { |
||||
get { |
||||
return settingsFileTextBox; |
||||
} |
||||
} |
||||
|
||||
public System.Windows.Forms.Button BrowseButton { |
||||
get { return browseButton; } |
||||
} |
||||
|
||||
public System.Windows.Forms.Button ModifyStyleCopSettingsButton { |
||||
get { return modifyStyleCopSettingsButton; } |
||||
} |
||||
|
||||
|
||||
public ConfigurationGuiBinding CreateBinding() |
||||
{ |
||||
return new ConfigBinding(this); |
||||
} |
||||
|
||||
class ConfigBinding : ConfigurationGuiBinding |
||||
{ |
||||
readonly AnalysisProjectOptions po; |
||||
|
||||
public ConfigBinding(AnalysisProjectOptions po) |
||||
{ |
||||
this.po = po; |
||||
this.TreatPropertyValueAsLiteral = false; |
||||
po.OptionChanged += delegate { |
||||
Helper.IsDirty = true; |
||||
}; |
||||
} |
||||
|
||||
public override void Load() |
||||
{ |
||||
|
||||
} |
||||
|
||||
public override bool Save() |
||||
{ |
||||
return true; |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
public event EventHandler OptionChanged; |
||||
|
||||
protected virtual void OnOptionChanged(EventArgs e) |
||||
{ |
||||
if (OptionChanged != null) { |
||||
OptionChanged(this, e); |
||||
} |
||||
} |
||||
|
||||
void BrowseButtonClick(object sender, EventArgs e) |
||||
{ |
||||
if(openFileDialog1.ShowDialog() == DialogResult.OK) |
||||
{ |
||||
settingsFileTextBox.Text = openFileDialog1.FileName; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -1,123 +0,0 @@
@@ -1,123 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<root> |
||||
<!-- |
||||
Microsoft ResX Schema |
||||
|
||||
Version 2.0 |
||||
|
||||
The primary goals of this format is to allow a simple XML format |
||||
that is mostly human readable. The generation and parsing of the |
||||
various data types are done through the TypeConverter classes |
||||
associated with the data types. |
||||
|
||||
Example: |
||||
|
||||
... ado.net/XML headers & schema ... |
||||
<resheader name="resmimetype">text/microsoft-resx</resheader> |
||||
<resheader name="version">2.0</resheader> |
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
||||
<value>[base64 mime encoded serialized .NET Framework object]</value> |
||||
</data> |
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
||||
<comment>This is a comment</comment> |
||||
</data> |
||||
|
||||
There are any number of "resheader" rows that contain simple |
||||
name/value pairs. |
||||
|
||||
Each data row contains a name, and value. The row also contains a |
||||
type or mimetype. Type corresponds to a .NET class that support |
||||
text/value conversion through the TypeConverter architecture. |
||||
Classes that don't support this are serialized and stored with the |
||||
mimetype set. |
||||
|
||||
The mimetype is used for serialized objects, and tells the |
||||
ResXResourceReader how to depersist the object. This is currently not |
||||
extensible. For a given mimetype the value must be set accordingly: |
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format |
||||
that the ResXResourceWriter will generate, however the reader can |
||||
read any of the formats listed below. |
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64 |
||||
value : The object must be serialized with |
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
||||
: and then encoded with base64 encoding. |
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64 |
||||
value : The object must be serialized into a byte array |
||||
: using a System.ComponentModel.TypeConverter |
||||
: and then encoded with base64 encoding. |
||||
--> |
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
||||
<xsd:element name="root" msdata:IsDataSet="true"> |
||||
<xsd:complexType> |
||||
<xsd:choice maxOccurs="unbounded"> |
||||
<xsd:element name="metadata"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" use="required" type="xsd:string" /> |
||||
<xsd:attribute name="type" type="xsd:string" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="assembly"> |
||||
<xsd:complexType> |
||||
<xsd:attribute name="alias" type="xsd:string" /> |
||||
<xsd:attribute name="name" type="xsd:string" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="data"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
||||
<xsd:attribute ref="xml:space" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
<xsd:element name="resheader"> |
||||
<xsd:complexType> |
||||
<xsd:sequence> |
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||
</xsd:sequence> |
||||
<xsd:attribute name="name" type="xsd:string" use="required" /> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:choice> |
||||
</xsd:complexType> |
||||
</xsd:element> |
||||
</xsd:schema> |
||||
<resheader name="resmimetype"> |
||||
<value>text/microsoft-resx</value> |
||||
</resheader> |
||||
<resheader name="version"> |
||||
<value>2.0</value> |
||||
</resheader> |
||||
<resheader name="reader"> |
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<resheader name="writer"> |
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||
</resheader> |
||||
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
||||
<value>17, 17</value> |
||||
</metadata> |
||||
</root> |
||||
@ -1,130 +0,0 @@
@@ -1,130 +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.Diagnostics; |
||||
using System.Windows.Forms; |
||||
using System.IO; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui.OptionPanels; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
|
||||
namespace ICSharpCode.SourceAnalysis { |
||||
public class old_AnalysisProjectOptionsPanel : AbstractXmlFormsProjectOptionPanel { |
||||
|
||||
public override void LoadPanelContents() { |
||||
InitializeHelper(); |
||||
|
||||
var masterSettingsFile = helper.GetProperty<string>("SourceAnalysisOverrideSettingsFile", "", true); |
||||
if (masterSettingsFile.Length == 0) { |
||||
|
||||
helper.SetProperty<string>("SourceAnalysisOverrideSettingsFile", |
||||
StyleCopWrapper.GetMasterSettingsFile(), |
||||
true, |
||||
PropertyStorageLocations.Base); |
||||
} |
||||
|
||||
AnalysisProjectOptions po = new AnalysisProjectOptions(); |
||||
po.Dock = DockStyle.Fill; |
||||
Controls.Add(po); |
||||
|
||||
ChooseStorageLocationButton btnEnable; |
||||
ChooseStorageLocationButton btnFileLocation; |
||||
btnEnable = helper.BindBoolean(po.EnableCheckBox, "RunSourceAnalysis", false).CreateLocationButton(po.EnableCheckBox); |
||||
btnFileLocation = helper.BindString(po.SettingsFileTextBox, "SourceAnalysisOverrideSettingsFile", TextBoxEditMode.EditRawProperty).CreateLocationButton(po.SettingsFileTextBox); |
||||
ConfigurationGuiBinding binding = po.CreateBinding(); |
||||
binding.RegisterLocationButton(btnEnable); |
||||
binding.RegisterLocationButton(btnFileLocation); |
||||
|
||||
helper.AddConfigurationSelector(this); |
||||
|
||||
po.ModifyStyleCopSettingsButton.Click += ModifyStyleCopSettingsClick; |
||||
} |
||||
|
||||
void ModifyStyleCopSettingsClick(object sender, EventArgs e) { |
||||
var settingsFile = helper.GetProperty<string>("SourceAnalysisOverrideSettingsFile", "", true); |
||||
|
||||
if (settingsFile == StyleCopWrapper.GetMasterSettingsFile()) { |
||||
if (ConfirmSwitchFromMaster()) { |
||||
settingsFile = CopyFromMaster(); |
||||
} |
||||
} |
||||
|
||||
if (!System.IO.File.Exists(settingsFile)) { |
||||
if (ConfirmReplaceMissingFile()) { |
||||
settingsFile = CopyFromMaster(); |
||||
} |
||||
else { |
||||
MessageService.ShowWarning("No settings file found to modify."); |
||||
return; |
||||
} |
||||
} |
||||
|
||||
string styleCopPath = StyleCopWrapper.FindStyleCopPath(); |
||||
string executable; |
||||
if (styleCopPath != null) |
||||
executable = Path.Combine(Path.GetDirectoryName(styleCopPath), "StyleCopSettingsEditor.exe"); |
||||
else |
||||
executable = null; |
||||
string parameters = "\"" + settingsFile + "\""; |
||||
if (!File.Exists(executable)) { |
||||
LoggingService.Debug("StyleCopSettingsEditor.exe: " + executable); |
||||
MessageService.ShowWarning("Unable to find the StyleCop Settings editor. Please specify the StyleCop location in Tools Options."); |
||||
return; |
||||
} |
||||
|
||||
using(Process p = Process.Start("\"" + executable + "\"", parameters)) { |
||||
// No need to wait for the settings dialog to close - we can leave it open.
|
||||
} |
||||
} |
||||
|
||||
private bool ConfirmReplaceMissingFile() { |
||||
var result = MessageBox.Show("A settings file is not present. Would you like to copy the master into the " + |
||||
"project folder?", |
||||
"Missing Settings File", |
||||
MessageBoxButtons.YesNo, |
||||
MessageBoxIcon.Exclamation, |
||||
MessageBoxDefaultButton.Button1 |
||||
); |
||||
if (result == DialogResult.Yes) { |
||||
return true; |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
private bool ConfirmSwitchFromMaster() |
||||
{ |
||||
var result = MessageBox.Show("You are currently using the master settings file. Do you want to make a " |
||||
+ "copy in the project folder instead?", |
||||
"Using Master Settings File", |
||||
MessageBoxButtons.YesNo, |
||||
MessageBoxIcon.Exclamation, |
||||
MessageBoxDefaultButton.Button1 |
||||
); |
||||
if (result == DialogResult.Yes) |
||||
{ |
||||
return true; |
||||
} |
||||
else |
||||
{ |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
private string CopyFromMaster() { |
||||
var newSettingsFile = helper.Project.Directory + "\\Settings.SourceAnalysis"; |
||||
System.IO.File.Copy( |
||||
StyleCopWrapper.GetMasterSettingsFile(), |
||||
newSettingsFile, |
||||
true |
||||
); |
||||
helper.SetProperty<string>("SourceAnalysisOverrideSettingsFile", |
||||
newSettingsFile, |
||||
true, |
||||
PropertyStorageLocations.Base |
||||
); |
||||
return newSettingsFile; |
||||
} |
||||
} |
||||
} |
||||
@ -1,381 +0,0 @@
@@ -1,381 +0,0 @@
|
||||
<Components version="1.0"> |
||||
<System.Windows.Forms.UserControl> |
||||
<Name value="XmlUserControl1" /> |
||||
<ClientSize value="{Width=527, Height=715}" /> |
||||
<AutoScroll value="True" /> |
||||
<Controls> |
||||
<System.Windows.Forms.GroupBox> |
||||
<Name value="generalGroupBox" /> |
||||
<Location value="3, 3" /> |
||||
<Text value="${res:Dialog.ProjectOptions.BuildOptions.General}" /> |
||||
<Size value="521, 152" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="0" /> |
||||
<Controls> |
||||
<System.Windows.Forms.ComboBox> |
||||
<Name value="optionInferComboBox" /> |
||||
<TabIndex value="8" /> |
||||
<Location value="394, 125" /> |
||||
<Size value="121, 21" /> |
||||
<FormattingEnabled value="True" /> |
||||
<DropDownStyle value="DropDownList" /> |
||||
</System.Windows.Forms.ComboBox> |
||||
<System.Windows.Forms.ComboBox> |
||||
<Name value="optionCompareComboBox" /> |
||||
<TabIndex value="7" /> |
||||
<Location value="267, 125" /> |
||||
<Size value="121, 21" /> |
||||
<FormattingEnabled value="True" /> |
||||
<DropDownStyle value="DropDownList" /> |
||||
</System.Windows.Forms.ComboBox> |
||||
<System.Windows.Forms.ComboBox> |
||||
<Name value="optionStrictComboBox" /> |
||||
<TabIndex value="6" /> |
||||
<Location value="140, 125" /> |
||||
<Size value="121, 21" /> |
||||
<FormattingEnabled value="True" /> |
||||
<DropDownStyle value="DropDownList" /> |
||||
</System.Windows.Forms.ComboBox> |
||||
<System.Windows.Forms.ComboBox> |
||||
<Name value="optionExplicitComboBox" /> |
||||
<TabIndex value="5" /> |
||||
<Location value="13, 125" /> |
||||
<Size value="121, 21" /> |
||||
<FormattingEnabled value="True" /> |
||||
<DropDownStyle value="DropDownList" /> |
||||
</System.Windows.Forms.ComboBox> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="label10" /> |
||||
<Location value="6, 111" /> |
||||
<Text value="${res:Dialog.ProjectOptions.BuildOptions.VBOptionsDefaultValues}" /> |
||||
<Size value="218, 23" /> |
||||
<TabIndex value="4" /> |
||||
</System.Windows.Forms.Label> |
||||
<System.Windows.Forms.CheckBox> |
||||
<Name value="removeOverflowCheckBox" /> |
||||
<Location value="12, 84" /> |
||||
<Text value="${res:Dialog.ProjectOptions.BuildOptions.RemoveOverflowChecks}" /> |
||||
<TabIndex value="3" /> |
||||
<Size value="502, 24" /> |
||||
</System.Windows.Forms.CheckBox> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="label1" /> |
||||
<Location value="6, 17" /> |
||||
<Text value="${res:Dialog.ProjectOptions.BuildOptions.ConditionalSymbols}" /> |
||||
<Size value="470, 16" /> |
||||
<TextAlign value="BottomLeft" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="0" /> |
||||
</System.Windows.Forms.Label> |
||||
<System.Windows.Forms.TextBox> |
||||
<Name value="conditionalSymbolsTextBox" /> |
||||
<TabIndex value="1" /> |
||||
<Location value="13, 36" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<Size value="502, 20" /> |
||||
</System.Windows.Forms.TextBox> |
||||
<System.Windows.Forms.CheckBox> |
||||
<Name value="optimizeCodeCheckBox" /> |
||||
<AccessibleRole value="None" /> |
||||
<Location value="13, 64" /> |
||||
<Text value="${res:Dialog.ProjectOptions.BuildOptions.OptimizeCode}" /> |
||||
<TabIndex value="2" /> |
||||
<Size value="502, 24" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
</System.Windows.Forms.CheckBox> |
||||
</Controls> |
||||
</System.Windows.Forms.GroupBox> |
||||
<System.Windows.Forms.GroupBox> |
||||
<Name value="groupBox3" /> |
||||
<Location value="3, 161" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.Output}" /> |
||||
<Size value="521, 363" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="1" /> |
||||
<Controls> |
||||
<System.Windows.Forms.Button> |
||||
<Name value="projectUpdateButton" /> |
||||
<Location value="291, 113" /> |
||||
<Text value="Change" /> |
||||
<UseVisualStyleBackColor value="True" /> |
||||
<Size value="179, 23" /> |
||||
<TabIndex value="10" /> |
||||
</System.Windows.Forms.Button> |
||||
<System.Windows.Forms.GroupBox> |
||||
<Name value="advancedOutputGroupBox" /> |
||||
<Location value="6, 142" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.Advanced}" /> |
||||
<Size value="505, 215" /> |
||||
<Anchor value="Top, Bottom, Left, Right" /> |
||||
<TabIndex value="9" /> |
||||
<Controls> |
||||
<System.Windows.Forms.Panel> |
||||
<Name value="platformSpecificOptionsPanel" /> |
||||
<Location value="7, 17" /> |
||||
<TabIndex value="7" /> |
||||
<Size value="492, 106" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<Controls> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="label2" /> |
||||
<Location value="3, 27" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.GenerateSerializationAssembly}" /> |
||||
<Size value="181, 20" /> |
||||
<TextAlign value="MiddleRight" /> |
||||
<TabIndex value="1" /> |
||||
</System.Windows.Forms.Label> |
||||
<System.Windows.Forms.ComboBox> |
||||
<Name value="targetCpuComboBox" /> |
||||
<TabIndex value="4" /> |
||||
<Location value="190, 55" /> |
||||
<Size value="171, 21" /> |
||||
<FormattingEnabled value="True" /> |
||||
<DropDownStyle value="DropDownList" /> |
||||
</System.Windows.Forms.ComboBox> |
||||
<System.Windows.Forms.ComboBox> |
||||
<Name value="generateSerializationAssemblyComboBox" /> |
||||
<TabIndex value="2" /> |
||||
<Location value="190, 28" /> |
||||
<Size value="171, 21" /> |
||||
<FormattingEnabled value="True" /> |
||||
<DropDownStyle value="DropDownList" /> |
||||
</System.Windows.Forms.ComboBox> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="label9" /> |
||||
<Location value="3, 53" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.TargetCPU}" /> |
||||
<Size value="181, 23" /> |
||||
<TextAlign value="MiddleRight" /> |
||||
<TabIndex value="3" /> |
||||
</System.Windows.Forms.Label> |
||||
<System.Windows.Forms.CheckBox> |
||||
<Name value="registerCOMInteropCheckBox" /> |
||||
<Location value="172, 2" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.RegisterForCOM}" /> |
||||
<TabIndex value="0" /> |
||||
<Size value="320, 20" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
</System.Windows.Forms.CheckBox> |
||||
<System.Windows.Forms.TextBox> |
||||
<Name value="dllBaseAddressTextBox" /> |
||||
<TabIndex value="6" /> |
||||
<Location value="190, 80" /> |
||||
<Size value="171, 20" /> |
||||
</System.Windows.Forms.TextBox> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="label8" /> |
||||
<Location value="4, 80" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.DLLBaseAddress}" /> |
||||
<Size value="180, 23" /> |
||||
<TextAlign value="MiddleRight" /> |
||||
<TabIndex value="5" /> |
||||
</System.Windows.Forms.Label> |
||||
</Controls> |
||||
</System.Windows.Forms.Panel> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="baseIntermediateOutputPathLabel" /> |
||||
<Location value="6, 129" /> |
||||
<UseCompatibleTextRendering value="True" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.BaseIntermediateOutputPath}" /> |
||||
<Size value="480, 16" /> |
||||
<TextAlign value="BottomLeft" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="0" /> |
||||
</System.Windows.Forms.Label> |
||||
<System.Windows.Forms.TextBox> |
||||
<Name value="baseIntermediateOutputPathTextBox" /> |
||||
<TabIndex value="1" /> |
||||
<Location value="7, 148" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<Size value="429, 20" /> |
||||
</System.Windows.Forms.TextBox> |
||||
<System.Windows.Forms.Button> |
||||
<Name value="baseIntermediateOutputPathBrowseButton" /> |
||||
<Location value="447, 148" /> |
||||
<UseCompatibleTextRendering value="True" /> |
||||
<Text value="..." /> |
||||
<Size value="40, 21" /> |
||||
<Anchor value="Top, Right" /> |
||||
<TabIndex value="2" /> |
||||
</System.Windows.Forms.Button> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="intermediateOutputPathLabel" /> |
||||
<Location value="6, 172" /> |
||||
<UseCompatibleTextRendering value="True" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.IntermediateOutputPath}" /> |
||||
<Size value="480, 16" /> |
||||
<TextAlign value="BottomLeft" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="0" /> |
||||
</System.Windows.Forms.Label> |
||||
<System.Windows.Forms.TextBox> |
||||
<Name value="intermediateOutputPathTextBox" /> |
||||
<TabIndex value="1" /> |
||||
<Location value="6, 188" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<Size value="429, 20" /> |
||||
</System.Windows.Forms.TextBox> |
||||
<System.Windows.Forms.Button> |
||||
<Name value="intermediateOutputPathBrowseButton" /> |
||||
<Location value="446, 187" /> |
||||
<UseCompatibleTextRendering value="True" /> |
||||
<Text value="..." /> |
||||
<Size value="40, 21" /> |
||||
<Anchor value="Top, Right" /> |
||||
<TabIndex value="2" /> |
||||
</System.Windows.Forms.Button> |
||||
</Controls> |
||||
</System.Windows.Forms.GroupBox> |
||||
<System.Windows.Forms.ComboBox> |
||||
<Name value="targetFrameworkComboBox" /> |
||||
<TabIndex value="8" /> |
||||
<Location value="164, 115" /> |
||||
<Size value="121, 21" /> |
||||
<FormattingEnabled value="True" /> |
||||
<DropDownStyle value="DropDownList" /> |
||||
</System.Windows.Forms.ComboBox> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="targetFrameworkLabel" /> |
||||
<Location value="13, 115" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.TargetFramework}" /> |
||||
<Size value="150, 20" /> |
||||
<TabIndex value="7" /> |
||||
</System.Windows.Forms.Label> |
||||
<System.Windows.Forms.ComboBox> |
||||
<Name value="debugInfoComboBox" /> |
||||
<TabIndex value="6" /> |
||||
<Location value="164, 88" /> |
||||
<Size value="121, 21" /> |
||||
<FormattingEnabled value="True" /> |
||||
<DropDownStyle value="DropDownList" /> |
||||
</System.Windows.Forms.ComboBox> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="debugInfoLabel" /> |
||||
<Location value="13, 88" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.DebugInfo}" /> |
||||
<Size value="145, 23" /> |
||||
<TextAlign value="MiddleRight" /> |
||||
<TabIndex value="5" /> |
||||
</System.Windows.Forms.Label> |
||||
<System.Windows.Forms.CheckBox> |
||||
<Name value="xmlDocumentationCheckBox" /> |
||||
<Location value="13, 63" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.XmlDocumentationFile}" /> |
||||
<TabIndex value="3" /> |
||||
<Size value="151, 20" /> |
||||
</System.Windows.Forms.CheckBox> |
||||
<System.Windows.Forms.TextBox> |
||||
<Name value="xmlDocumentationTextBox" /> |
||||
<TabIndex value="4" /> |
||||
<Location value="164, 62" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<Size value="351, 20" /> |
||||
</System.Windows.Forms.TextBox> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="label5" /> |
||||
<Location value="6, 17" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.OutputPath}" /> |
||||
<Size value="505, 16" /> |
||||
<TextAlign value="BottomLeft" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="0" /> |
||||
</System.Windows.Forms.Label> |
||||
<System.Windows.Forms.TextBox> |
||||
<Name value="outputPathTextBox" /> |
||||
<TabIndex value="1" /> |
||||
<Location value="13, 36" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<Size value="457, 20" /> |
||||
</System.Windows.Forms.TextBox> |
||||
<System.Windows.Forms.Button> |
||||
<Name value="outputPathBrowseButton" /> |
||||
<Location value="475, 36" /> |
||||
<Text value="..." /> |
||||
<Size value="40, 21" /> |
||||
<Anchor value="Top, Right" /> |
||||
<TabIndex value="2" /> |
||||
</System.Windows.Forms.Button> |
||||
</Controls> |
||||
</System.Windows.Forms.GroupBox> |
||||
<System.Windows.Forms.GroupBox> |
||||
<Name value="treatWarningsAsErrorsGroupBox" /> |
||||
<Location value="3, 612" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.TreatWarningsAsErrors}" /> |
||||
<Size value="521, 100" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="3" /> |
||||
<Controls> |
||||
<System.Windows.Forms.TextBox> |
||||
<Name value="specificWarningsTextBox" /> |
||||
<TabIndex value="2" /> |
||||
<Location value="136, 44" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<Size value="377, 20" /> |
||||
</System.Windows.Forms.TextBox> |
||||
<System.Windows.Forms.RadioButton> |
||||
<Name value="allRadioButton" /> |
||||
<Location value="8, 68" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.TreatWarningsAsErrors.All}" /> |
||||
<Size value="128, 24" /> |
||||
<TabIndex value="3" /> |
||||
</System.Windows.Forms.RadioButton> |
||||
<System.Windows.Forms.RadioButton> |
||||
<Name value="specificWarningsRadioButton" /> |
||||
<Location value="8, 44" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.TreatWarningsAsErrors.Specific}" /> |
||||
<Size value="128, 24" /> |
||||
<TabIndex value="1" /> |
||||
</System.Windows.Forms.RadioButton> |
||||
<System.Windows.Forms.RadioButton> |
||||
<Name value="noneRadioButton" /> |
||||
<Location value="8, 20" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.TreatWarningsAsErrors.None}" /> |
||||
<Size value="128, 24" /> |
||||
<TabIndex value="0" /> |
||||
</System.Windows.Forms.RadioButton> |
||||
</Controls> |
||||
</System.Windows.Forms.GroupBox> |
||||
<System.Windows.Forms.GroupBox> |
||||
<Name value="warningsGroupBox" /> |
||||
<Location value="3, 526" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.ErrorsAndWarnings}" /> |
||||
<Size value="521, 80" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<TabIndex value="2" /> |
||||
<Controls> |
||||
<System.Windows.Forms.TextBox> |
||||
<Name value="suppressWarningsTextBox" /> |
||||
<TabIndex value="3" /> |
||||
<Location value="164, 44" /> |
||||
<Anchor value="Top, Left, Right" /> |
||||
<Size value="349, 20" /> |
||||
</System.Windows.Forms.TextBox> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="label4" /> |
||||
<Location value="4, 44" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.SuppressWarnings}" /> |
||||
<Size value="154, 23" /> |
||||
<TextAlign value="MiddleRight" /> |
||||
<TabIndex value="2" /> |
||||
</System.Windows.Forms.Label> |
||||
<System.Windows.Forms.ComboBox> |
||||
<Name value="warningLevelComboBox" /> |
||||
<TabIndex value="1" /> |
||||
<Location value="164, 20" /> |
||||
<Size value="60, 21" /> |
||||
<FormattingEnabled value="True" /> |
||||
<DropDownStyle value="DropDownList" /> |
||||
</System.Windows.Forms.ComboBox> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="label3" /> |
||||
<Location value="4, 20" /> |
||||
<Text value="${res:Dialog.ProjectOptions.Build.WarningLevel}" /> |
||||
<Size value="154, 23" /> |
||||
<TextAlign value="MiddleRight" /> |
||||
<TabIndex value="0" /> |
||||
</System.Windows.Forms.Label> |
||||
</Controls> |
||||
</System.Windows.Forms.GroupBox> |
||||
</Controls> |
||||
</System.Windows.Forms.UserControl> |
||||
</Components> |
||||
@ -1,62 +0,0 @@
@@ -1,62 +0,0 @@
|
||||
<Components version="1.0"> |
||||
<System.Windows.Forms.UserControl> |
||||
<Name value="XmlUserControl1" /> |
||||
<ClientSize value="{Width=497, Height=386}" /> |
||||
<AutoScroll value="True" /> |
||||
<Controls> |
||||
<System.Windows.Forms.GroupBox> |
||||
<Name value="generalGroupBox" /> |
||||
<Location value="{X=3,Y=3}" /> |
||||
<Text value="${res:Dialog.ProjectOptions.ProjectImports.Title}" /> |
||||
<Size value="{Width=491, Height=374}" /> |
||||
<TabIndex value="0" /> |
||||
<Anchor value="Top, Bottom, Left, Right" /> |
||||
<Controls> |
||||
<System.Windows.Forms.Label> |
||||
<Name value="label1" /> |
||||
<Location value="{X=230,Y=21}" /> |
||||
<Text value="${res:Dialog.ProjectOptions.ProjectImports.Namespace}" /> |
||||
<Size value="{Width=255, Height=15}" /> |
||||
<TabIndex value="4" /> |
||||
<Anchor value="Top, Right" /> |
||||
</System.Windows.Forms.Label> |
||||
<System.Windows.Forms.ComboBox> |
||||
<Name value="namespacesComboBox" /> |
||||
<Sorted value="True" /> |
||||
<TabIndex value="3" /> |
||||
<Anchor value="Top, Right" /> |
||||
<Size value="{Width=255, Height=21}" /> |
||||
<FormattingEnabled value="True" /> |
||||
<Location value="{X=230,Y=46}" /> |
||||
</System.Windows.Forms.ComboBox> |
||||
<System.Windows.Forms.Button> |
||||
<Name value="addImportButton" /> |
||||
<Location value="{X=230,Y=73}" /> |
||||
<Text value="${res:Dialog.ProjectOptions.ProjectImports.AddImport}" /> |
||||
<Size value="{Width=153, Height=23}" /> |
||||
<Anchor value="Top, Right" /> |
||||
<FlatAppearance value="System.Windows.Forms.FlatButtonAppearance" /> |
||||
<TabIndex value="2" /> |
||||
</System.Windows.Forms.Button> |
||||
<System.Windows.Forms.Button> |
||||
<Name value="removeImportButton" /> |
||||
<Location value="{X=230,Y=102}" /> |
||||
<Text value="${res:Dialog.ProjectOptions.ProjectImports.RemoveImport}" /> |
||||
<Size value="{Width=153, Height=23}" /> |
||||
<Anchor value="Top, Right" /> |
||||
<FlatAppearance value="System.Windows.Forms.FlatButtonAppearance" /> |
||||
<TabIndex value="1" /> |
||||
</System.Windows.Forms.Button> |
||||
<System.Windows.Forms.ListBox> |
||||
<Name value="importsListBox" /> |
||||
<TabIndex value="0" /> |
||||
<Anchor value="Top, Bottom, Left, Right" /> |
||||
<Size value="{Width=208, Height=342}" /> |
||||
<FormattingEnabled value="True" /> |
||||
<Location value="{X=16,Y=20}" /> |
||||
</System.Windows.Forms.ListBox> |
||||
</Controls> |
||||
</System.Windows.Forms.GroupBox> |
||||
</Controls> |
||||
</System.Windows.Forms.UserControl> |
||||
</Components> |
||||
@ -1,62 +0,0 @@
@@ -1,62 +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 ICSharpCode.VBNetBinding.OptionPanels |
||||
{ |
||||
public class BuildOptions : AbstractBuildOptions |
||||
{ |
||||
public override void LoadPanelContents() |
||||
{ |
||||
SetupFromXmlResource("BuildOptions.xfrm"); |
||||
InitializeHelper(); |
||||
|
||||
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("removeOverflowCheckBox", "RemoveIntegerChecks", false); |
||||
b.CreateLocationButton("removeOverflowCheckBox"); |
||||
|
||||
ChooseStorageLocationButton locationButton; |
||||
b = helper.BindStringEnum("optionExplicitComboBox", "OptionExplicit", "On", |
||||
new StringPair("Off", "Explicit Off"), |
||||
new StringPair("On", "Explicit On")); |
||||
locationButton = b.CreateLocationButton("optionExplicitComboBox"); |
||||
b = helper.BindStringEnum("optionStrictComboBox", "OptionStrict", "Off", |
||||
new StringPair("Off", "Strict Off"), |
||||
new StringPair("On", "Strict On")); |
||||
b.RegisterLocationButton(locationButton); |
||||
b = helper.BindStringEnum("optionCompareComboBox", "OptionCompare", "Binary", |
||||
new StringPair("Binary", "Compare Binary"), |
||||
new StringPair("Text", "Compare Text")); |
||||
b.RegisterLocationButton(locationButton); |
||||
b = helper.BindStringEnum("optionInferComboBox", "OptionInfer", "Off", |
||||
new StringPair("Off", "Infer Off"), |
||||
new StringPair("On", "Infer On")); |
||||
b.RegisterLocationButton(locationButton); |
||||
|
||||
InitBaseIntermediateOutputPath(); |
||||
InitIntermediateOutputPath(); |
||||
InitOutputPath(); |
||||
InitXmlDoc(); |
||||
InitTargetFramework(); |
||||
|
||||
InitDebugInfo(); |
||||
InitAdvanced(); |
||||
InitWarnings(); |
||||
|
||||
helper.AddConfigurationSelector(this); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,150 @@
@@ -0,0 +1,150 @@
|
||||
<optionpanels:ProjectOptionPanel |
||||
x:Class="ICSharpCode.VBNetBinding.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" |
||||
xmlns:project="clr-namespace:ICSharpCode.SharpDevelop.Project;assembly=ICSharpCode.SharpDevelop" |
||||
xmlns:optionpanels="clr-namespace:ICSharpCode.SharpDevelop.Gui.OptionPanels;assembly=ICSharpCode.SharpDevelop" |
||||
xmlns:core="http://icsharpcode.net/sharpdevelop/core" |
||||
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"> |
||||
|
||||
<optionpanels:ProjectOptionPanel.Resources> |
||||
<optionpanels:StorageLocationConverter x:Key="locationConverter"></optionpanels:StorageLocationConverter> |
||||
<optionpanels:StringToBoolConverter x:Key="strToBool"></optionpanels:StringToBoolConverter> |
||||
</optionpanels:ProjectOptionPanel.Resources> |
||||
|
||||
<ScrollViewer> |
||||
<StackPanel> |
||||
<GroupBox Header="{core:Localize Dialog.ProjectOptions.BuildOptions.General}"> |
||||
<Grid> |
||||
<Grid.RowDefinitions> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto" ></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
</Grid.RowDefinitions> |
||||
<Grid.ColumnDefinitions> |
||||
<ColumnDefinition Width="30"></ColumnDefinition> |
||||
<ColumnDefinition></ColumnDefinition> |
||||
<ColumnDefinition></ColumnDefinition> |
||||
</Grid.ColumnDefinitions> |
||||
|
||||
<Label Grid.ColumnSpan="3" VerticalAlignment="Center" |
||||
Content="{core:Localize Dialog.ProjectOptions.BuildOptions.ConditionalSymbols}"></Label> |
||||
|
||||
<optionpanels:StorageLocationPicker Grid.Row="1" Margin="0,8,0,8" |
||||
Location="{Binding DefineConstants.Location}" /> |
||||
<TextBox x:Name="conditionalSymbolsTextBox" VerticalAlignment="Center" |
||||
Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" |
||||
Text="{Binding DefineConstants.Value, UpdateSourceTrigger=PropertyChanged}"> |
||||
</TextBox> |
||||
|
||||
<optionpanels:StorageLocationPicker Grid.Row="2" Margin="0,3,0,0" Location="{Binding Optimize.Location}" /> |
||||
<CheckBox x:Name="optimizeCodeCheckBox" VerticalAlignment="Center" |
||||
Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" |
||||
Content="{core:Localize Dialog.ProjectOptions.BuildOptions.OptimizeCode}" |
||||
IsChecked="{Binding Optimize.Value,Converter={StaticResource strToBool}}"> |
||||
</CheckBox> |
||||
|
||||
<optionpanels:StorageLocationPicker Grid.Row="3" Margin="0,3,0,0" Location="{Binding RemoveIntegerChecks.Location}" /> |
||||
<CheckBox x:Name="removeOverflowCheckBox" |
||||
Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" VerticalAlignment="Center" |
||||
Content="{core:Localize Dialog.ProjectOptions.BuildOptions.RemoveOverflowChecks}" |
||||
IsChecked="{Binding RemoveIntegerChecks.Value,Converter={StaticResource strToBool}}"> |
||||
</CheckBox> |
||||
|
||||
<optionpanels:StorageLocationPicker Grid.Row="5" Margin="0,3,0,0" VerticalAlignment="Center" > |
||||
<optionpanels:StorageLocationPicker.Location> |
||||
<MultiBinding |
||||
Converter="{StaticResource locationConverter}"> |
||||
<Binding Path="OptionExplicit.Location" /> |
||||
<Binding Path="OptionStrict.Location" /> |
||||
<Binding Path="OptionCompare.Location" /> |
||||
<Binding Path="OptionInfer.Location" /> |
||||
</MultiBinding> |
||||
</optionpanels:StorageLocationPicker.Location> |
||||
</optionpanels:StorageLocationPicker> |
||||
|
||||
<widgets:StackPanelWithSpacing Grid.Row="5" Grid.Column="1" |
||||
Orientation="Horizontal" SpaceBetweenItems="8"> |
||||
<ComboBox |
||||
VerticalAlignment="Center" |
||||
ItemsSource="{Binding OptionExplicitItems}" |
||||
SelectedValue="{Binding Path=OptionExplicit.Value}" |
||||
DisplayMemberPath="DisplayValue" |
||||
SelectedValuePath="Key"> |
||||
</ComboBox> |
||||
|
||||
<ComboBox |
||||
VerticalAlignment="Center" |
||||
ItemsSource="{Binding OptionStrictItems}" |
||||
SelectedValue="{Binding Path=OptionStrict.Value}" |
||||
DisplayMemberPath="DisplayValue" |
||||
SelectedValuePath="Key" |
||||
></ComboBox> |
||||
<!--<ComboBox Grid.Row="1" Grid.Column="2" |
||||
VerticalAlignment="Center" |
||||
ItemsSource="{Binding Path=DataContext.SerializationInfo}" |
||||
SelectedValue="{Binding Path=GenerateSerializationAssemblies.Value}" |
||||
DisplayMemberPath="DisplayValue" |
||||
SelectedValuePath="Key"></ComboBox>--> |
||||
<ComboBox |
||||
VerticalAlignment="Center" |
||||
ItemsSource="{Binding OptionCompareItems}" |
||||
SelectedValue="{Binding Path=OptionCompare.Value}" |
||||
DisplayMemberPath="DisplayValue" |
||||
SelectedValuePath="Key"> |
||||
</ComboBox> |
||||
<ComboBox VerticalAlignment="Center" |
||||
ItemsSource="{Binding OptionInferItems}" |
||||
SelectedValue="{Binding Path=OptionInfer.Value}" |
||||
DisplayMemberPath="DisplayValue" |
||||
SelectedValuePath="Key"> |
||||
</ComboBox> |
||||
</widgets:StackPanelWithSpacing> |
||||
</Grid> |
||||
</GroupBox> |
||||
|
||||
<GroupBox Header="{core:Localize Dialog.ProjectOptions.Build.Output}"> |
||||
<Grid > |
||||
<Grid.RowDefinitions> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition Height="Auto"></RowDefinition> |
||||
<RowDefinition></RowDefinition> |
||||
</Grid.RowDefinitions> |
||||
<Grid.ColumnDefinitions> |
||||
<ColumnDefinition Width="Auto"></ColumnDefinition> |
||||
<ColumnDefinition Width="Auto"></ColumnDefinition> |
||||
<ColumnDefinition Width="*"></ColumnDefinition> |
||||
<ColumnDefinition Width="50"></ColumnDefinition> |
||||
</Grid.ColumnDefinitions> |
||||
<optionpanels:BuildOutput x:Name="buildOutput" Grid.ColumnSpan="3"> |
||||
</optionpanels:BuildOutput> |
||||
|
||||
|
||||
<GroupBox Grid.Row="5" Grid.ColumnSpan="4" Margin="5,10,0,0" Header="{core:Localize Dialog.ProjectOptions.Build.Advanced}"> |
||||
<optionpanels:BuildAdvanced x:Name="buildAdvanced"> |
||||
</optionpanels:BuildAdvanced> |
||||
</GroupBox> |
||||
</Grid> |
||||
</GroupBox> |
||||
|
||||
|
||||
<GroupBox Margin="0,8,0,0" Header="{core:Localize Dialog.ProjectOptions.Build.TreatWarningsAsErrors}"> |
||||
<optionpanels:ErrorsAndWarnings x:Name="errorsAndWarnings"> |
||||
</optionpanels:ErrorsAndWarnings> |
||||
</GroupBox> |
||||
|
||||
<GroupBox Margin="0,8,0,0" Header="{core:Localize Dialog.ProjectOptions.Build.ErrorsAndWarnings}"> |
||||
<optionpanels:TreatErrorsAndWarnings x:Name="treatErrorsAndWarnings"> |
||||
</optionpanels:TreatErrorsAndWarnings> |
||||
</GroupBox> |
||||
|
||||
</StackPanel> |
||||
</ScrollViewer> |
||||
</optionpanels:ProjectOptionPanel> |
||||
@ -0,0 +1,135 @@
@@ -0,0 +1,135 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Peter Forstmeier |
||||
* Date: 06.08.2012 |
||||
* Time: 19:43 |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.SharpDevelop.Gui.OptionPanels; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
|
||||
namespace ICSharpCode.VBNetBinding.OptionPanels |
||||
{ |
||||
/// <summary>
|
||||
/// Interaction logic for BuildOptionsXaml.xaml
|
||||
/// </summary>
|
||||
public partial class BuildOptions : ProjectOptionPanel |
||||
{ |
||||
public BuildOptions() |
||||
{ |
||||
InitializeComponent(); |
||||
DataContext = this; |
||||
|
||||
|
||||
optionExplicitItems = new List<KeyItemPair>(); |
||||
optionExplicitItems.Add(new KeyItemPair("Off","Explicit Off")); |
||||
optionExplicitItems.Add(new KeyItemPair("On","Explicit On")); |
||||
OptionExplicitItems = optionExplicitItems; |
||||
|
||||
optionStrictItems = new List<KeyItemPair>(); |
||||
optionStrictItems.Add(new KeyItemPair("Off", "Strict Off")); |
||||
optionStrictItems.Add(new KeyItemPair("On", "Strict On")); |
||||
OptionStrictItems = optionStrictItems; |
||||
|
||||
|
||||
optionCompareItems = new List<KeyItemPair>(); |
||||
optionCompareItems.Add(new KeyItemPair("Binary", "Compare Binary")); |
||||
optionCompareItems.Add(new KeyItemPair("Text", "Compare Text")); |
||||
OptionCompareItems = optionCompareItems; |
||||
|
||||
optionInferItems = new List<KeyItemPair>(); |
||||
optionInferItems.Add(new KeyItemPair("Off", "Infer Off")); |
||||
optionInferItems.Add(new KeyItemPair("On", "Infer On")); |
||||
OptionInferItems = optionInferItems; |
||||
} |
||||
|
||||
|
||||
public ProjectProperty<string> DefineConstants { |
||||
get { return GetProperty("DefineConstants", "", TextBoxEditMode.EditRawProperty); } |
||||
} |
||||
|
||||
public ProjectProperty<bool> Optimize { |
||||
get { return GetProperty("Optimize", false, PropertyStorageLocations.ConfigurationSpecific); } |
||||
} |
||||
|
||||
public ProjectProperty<string> RemoveIntegerChecks { |
||||
get { return GetProperty("RemoveIntegerChecks", "", TextBoxEditMode.EditRawProperty); } |
||||
} |
||||
|
||||
public ProjectProperty<string> OptionExplicit { |
||||
get {return GetProperty("OptionExplicit", "", TextBoxEditMode.EditRawProperty); } |
||||
} |
||||
|
||||
public ProjectProperty<string> OptionStrict { |
||||
get { return GetProperty("OptionStrict", "Off", TextBoxEditMode.EditRawProperty); } |
||||
} |
||||
|
||||
public ProjectProperty<string> OptionCompare { |
||||
get { return GetProperty("OptionCompare", "Binary", TextBoxEditMode.EditRawProperty); } |
||||
} |
||||
|
||||
public ProjectProperty<string> OptionInfer { |
||||
get { return GetProperty("OptionInfer", "Off", TextBoxEditMode.EditRawProperty); } |
||||
} |
||||
|
||||
|
||||
#region OptionItems
|
||||
|
||||
List<KeyItemPair> optionExplicitItems; |
||||
|
||||
public List<KeyItemPair> OptionExplicitItems { |
||||
get { return optionExplicitItems; } |
||||
set { optionExplicitItems = value; |
||||
base.RaisePropertyChanged(() => OptionExplicitItems); |
||||
} |
||||
} |
||||
|
||||
|
||||
List<KeyItemPair> optionStrictItems; |
||||
|
||||
public List<KeyItemPair> OptionStrictItems { |
||||
get { return optionStrictItems; } |
||||
set { optionStrictItems = value; |
||||
base.RaisePropertyChanged(() => OptionStrictItems); |
||||
} |
||||
} |
||||
|
||||
|
||||
private List<KeyItemPair> optionCompareItems; |
||||
|
||||
public List<KeyItemPair> OptionCompareItems { |
||||
get { return optionCompareItems; } |
||||
set { optionCompareItems = value; |
||||
base.RaisePropertyChanged(() => OptionCompareItems); |
||||
} |
||||
} |
||||
|
||||
|
||||
List<KeyItemPair> optionInferItems; |
||||
|
||||
public List<KeyItemPair> OptionInferItems { |
||||
get { return optionInferItems; } |
||||
set { optionInferItems = value; |
||||
base.RaisePropertyChanged(()=>OptionInferItems); |
||||
} |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region overrides
|
||||
|
||||
|
||||
protected override void Initialize() |
||||
{ |
||||
base.Initialize(); |
||||
buildOutput.Initialize(this); |
||||
this.buildAdvanced.Initialize(this); |
||||
this.errorsAndWarnings.Initialize(this); |
||||
this.treatErrorsAndWarnings.Initialize(this); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue