5 changed files with 71 additions and 7 deletions
@ -1,4 +1,4 @@ |
|||||||
<gui:OptionPanel x:Class="ICSharpCode.CodeAnalysis.AnalysisIdeOptionsPanelXaml" |
<gui:OptionPanel x:Class="ICSharpCode.CodeAnalysis.AnalysisIdeOptionsPanel" |
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||||
xmlns:core="http://icsharpcode.net/sharpdevelop/core" |
xmlns:core="http://icsharpcode.net/sharpdevelop/core" |
||||||
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui;assembly=ICSharpCode.SharpDevelop" |
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui;assembly=ICSharpCode.SharpDevelop" |
||||||
@ -0,0 +1,64 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Peter Forstmeier |
||||||
|
* Date: 19.07.2012 |
||||||
|
* Time: 21:27 |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
using System; |
||||||
|
using System.IO; |
||||||
|
using ICSharpCode.Core; |
||||||
|
using ICSharpCode.SharpDevelop.Gui; |
||||||
|
using ICSharpCode.SharpDevelop.Gui.OptionPanels; |
||||||
|
|
||||||
|
namespace ICSharpCode.CodeAnalysis |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for AnalysisIdeOptionsPanelXaml.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class AnalysisIdeOptionsPanel : OptionPanel |
||||||
|
{ |
||||||
|
public AnalysisIdeOptionsPanel() |
||||||
|
{ |
||||||
|
InitializeComponent(); |
||||||
|
ShowStatus(); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
private void ShowStatus() |
||||||
|
{ |
||||||
|
string path = FxCopWrapper.FindFxCopPath(); |
||||||
|
if (path == null) { |
||||||
|
status.Text = StringParser.Parse("${res:ICSharpCode.CodeAnalysis.IdeOptions.FxCopNotFound}"); |
||||||
|
} else { |
||||||
|
status.Text = StringParser.Parse("${res:ICSharpCode.CodeAnalysis.IdeOptions.FxCopFoundInPath}") |
||||||
|
+ Environment.NewLine + path; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
private void FindFxCopPath_Click(object sender, System.Windows.RoutedEventArgs e) |
||||||
|
{ |
||||||
|
string s = OptionsHelper.OpenFile("${res:SharpDevelop.FileFilter.ExecutableFiles}|*.exe;"); |
||||||
|
if (!String.IsNullOrEmpty(s)) { |
||||||
|
string path = Path.GetDirectoryName(s); |
||||||
|
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); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue