Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1887 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
9 changed files with 130 additions and 6 deletions
Binary file not shown.
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
<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,68 @@
@@ -0,0 +1,68 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
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 AnalysisIdeOptionsPanel : AbstractOptionPanel |
||||
{ |
||||
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 PropertyService.Get("CodeAnalysis.FxCopPath"); |
||||
} |
||||
set { |
||||
PropertyService.Set("CodeAnalysis.FxCopPath", value); |
||||
} |
||||
} |
||||
} |
||||
} |
Binary file not shown.
Loading…
Reference in new issue