Browse Source

Some FxCop cleanup

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4780 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
c21ee80fc1
  1. 16
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Converters.cs
  2. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/WpfDesign.XamlDom.csproj
  3. 6
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs
  4. 1
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/ServiceContainer.cs

16
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Converters.cs

@ -11,7 +11,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters @@ -11,7 +11,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters
{
public class IntFromEnumConverter : IValueConverter
{
public static IntFromEnumConverter Instance = new IntFromEnumConverter();
public static readonly IntFromEnumConverter Instance = new IntFromEnumConverter();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
@ -26,7 +26,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters @@ -26,7 +26,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters
public class HiddenWhenFalse : IValueConverter
{
public static HiddenWhenFalse Instance = new HiddenWhenFalse();
public static readonly HiddenWhenFalse Instance = new HiddenWhenFalse();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
@ -41,7 +41,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters @@ -41,7 +41,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters
public class CollapsedWhenFalse : IValueConverter
{
public static CollapsedWhenFalse Instance = new CollapsedWhenFalse();
public static readonly CollapsedWhenFalse Instance = new CollapsedWhenFalse();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
@ -56,7 +56,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters @@ -56,7 +56,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters
public class LevelConverter : IValueConverter
{
public static LevelConverter Instance = new LevelConverter();
public static readonly LevelConverter Instance = new LevelConverter();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
@ -71,7 +71,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters @@ -71,7 +71,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters
public class CollapsedWhenZero : IValueConverter
{
public static CollapsedWhenZero Instance = new CollapsedWhenZero();
public static readonly CollapsedWhenZero Instance = new CollapsedWhenZero();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
@ -89,7 +89,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters @@ -89,7 +89,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters
public class FalseWhenNull : IValueConverter
{
public static FalseWhenNull Instance = new FalseWhenNull();
public static readonly FalseWhenNull Instance = new FalseWhenNull();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
@ -104,7 +104,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters @@ -104,7 +104,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters
public class BoldWhenTrue : IValueConverter
{
public static BoldWhenTrue Instance = new BoldWhenTrue();
public static readonly BoldWhenTrue Instance = new BoldWhenTrue();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
@ -120,7 +120,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters @@ -120,7 +120,7 @@ namespace ICSharpCode.WpfDesign.Designer.Converters
// Boxed int throw exception without converter (wpf bug?)
public class DummyConverter : IValueConverter
{
public static DummyConverter Instance = new DummyConverter();
public static readonly DummyConverter Instance = new DummyConverter();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/WpfDesign.XamlDom.csproj

@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
<DelaySign>False</DelaySign>
<AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>
<RunCodeAnalysis>False</RunCodeAnalysis>
<CodeAnalysisRules>-Microsoft.Performance#CA1800</CodeAnalysisRules>
<CodeAnalysisRules>-Microsoft.Globalization#CA1303;-Microsoft.Performance#CA1800</CodeAnalysisRules>
<OutputPath>..\..\..\..\..\..\AddIns\AddIns\DisplayBindings\WpfDesign\</OutputPath>
<DocumentationFile>..\..\..\..\..\..\AddIns\AddIns\DisplayBindings\WpfDesign\ICSharpCode.WpfDesign.XamlDom.xml</DocumentationFile>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>

6
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs

@ -75,6 +75,8 @@ namespace ICSharpCode.WpfDesign.XamlDom @@ -75,6 +75,8 @@ namespace ICSharpCode.WpfDesign.XamlDom
{
if (reader == null)
throw new ArgumentNullException("reader");
if (settings == null)
throw new ArgumentNullException("settings");
XmlDocument doc = new PositionXmlDocument();
var errorSink = (IXamlErrorSink)settings.ServiceProvider.GetService(typeof(IXamlErrorSink));
@ -100,10 +102,10 @@ namespace ICSharpCode.WpfDesign.XamlDom @@ -100,10 +102,10 @@ namespace ICSharpCode.WpfDesign.XamlDom
Justification="We need to continue parsing, and the error is reported to the user.")]
internal static XamlDocument Parse(XmlDocument document, XamlParserSettings settings)
{
if (settings == null)
throw new ArgumentNullException("settings");
if (document == null)
throw new ArgumentNullException("document");
if (settings == null)
throw new ArgumentNullException("settings");
XamlParser p = new XamlParser();
p.settings = settings;
p.errorSink = (IXamlErrorSink)settings.ServiceProvider.GetService(typeof(IXamlErrorSink));

1
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/ServiceContainer.cs

@ -100,6 +100,7 @@ namespace ICSharpCode.WpfDesign @@ -100,6 +100,7 @@ namespace ICSharpCode.WpfDesign
/// Gets a required service.
/// Never returns null; instead a ServiceRequiredException is thrown when the service cannot be found.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
public T GetRequiredService<T>() where T : class
{
T service = (T)GetService(typeof(T));

Loading…
Cancel
Save