Browse Source

Treat warnings as errors.

In Release build in main Avalonia assemblies (couldn't do it in
Avalonia.Markup.Xaml due to warnings in OmniXaml). To do this, fixed a
number of warnings.
pull/734/head
Steven Kirk 10 years ago
parent
commit
ca17c50bf4
  1. 26
      samples/ControlCatalog.Android/ControlCatalog.Android.v2.ncrunchproject
  2. 2
      src/Android/Avalonia.Android/Platform/SkiaPlatform/MainWindowImpl.cs
  3. 2
      src/Avalonia.Animation/Avalonia.Animation.csproj
  4. 1
      src/Avalonia.Base/Avalonia.Base.csproj
  5. 2
      src/Avalonia.Base/Data/InstancedBinding.cs
  6. 3
      src/Avalonia.Base/Platform/IPlatformThreadingInterface.cs
  7. 1
      src/Avalonia.Base/PriorityBindingEntry.cs
  8. 6
      src/Avalonia.Controls/AppBuilderBase.cs
  9. 1
      src/Avalonia.Controls/Avalonia.Controls.csproj
  10. 5
      src/Avalonia.Controls/Generators/TreeItemContainerGenerator.cs
  11. 3
      src/Avalonia.Controls/HotkeyManager.cs
  12. 1
      src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj
  13. 22
      src/Avalonia.DotNetFrameworkRuntime/AppBuilder.cs
  14. 1
      src/Avalonia.DotNetFrameworkRuntime/Avalonia.DotNetFrameworkRuntime.csproj
  15. 1
      src/Avalonia.Input/Avalonia.Input.csproj
  16. 1
      src/Avalonia.Interactivity/Avalonia.Interactivity.csproj
  17. 1
      src/Avalonia.Layout/Avalonia.Layout.csproj
  18. 3
      src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj
  19. 12
      src/Avalonia.Logging.Serilog/SerilogLogger.cs
  20. 1
      src/Avalonia.SceneGraph/Avalonia.SceneGraph.csproj
  21. 24
      src/Avalonia.SceneGraph/Media/DrawingContext.cs
  22. 1
      src/Avalonia.SceneGraph/Media/Imaging/RenderTargetBitmap.cs
  23. 1
      src/Avalonia.SceneGraph/Media/MatrixTransform.cs
  24. 1
      src/Avalonia.SceneGraph/Media/RotateTransform.cs
  25. 1
      src/Avalonia.SceneGraph/Media/ScaleTransform.cs
  26. 1
      src/Avalonia.SceneGraph/Media/Transform.cs
  27. 1
      src/Avalonia.SceneGraph/Media/TranslateTransform.cs
  28. 1
      src/Avalonia.Styling/Avalonia.Styling.csproj
  29. 6
      src/Avalonia.Styling/Styling/SelectorMatch.cs
  30. 1
      src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj
  31. 2
      src/Gtk/Avalonia.Gtk/EmbeddableImpl.cs
  32. 12
      src/Markup/Avalonia.Markup.Xaml/AvaloniaXamlLoader.cs
  33. 1
      src/Markup/Avalonia.Markup/Avalonia.Markup.csproj
  34. 10
      src/Shared/PlatformSupport/AssetLoader.cs
  35. 1
      src/Windows/Avalonia.Direct2D1/Avalonia.Direct2D1.csproj
  36. 4
      src/Windows/Avalonia.Direct2D1/Media/StreamGeometryImpl.cs
  37. 1
      src/Windows/Avalonia.Win32/Avalonia.Win32.csproj
  38. 2
      tests/Avalonia.Controls.UnitTests/Primitives/TabStripTests.cs
  39. 2
      tests/Avalonia.Styling.UnitTests/TestControlBase.cs

26
samples/ControlCatalog.Android/ControlCatalog.Android.v2.ncrunchproject

@ -0,0 +1,26 @@
<ProjectConfiguration>
<AutoDetectNugetBuildDependencies>true</AutoDetectNugetBuildDependencies>
<BuildPriority>1000</BuildPriority>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<AllowCodeAnalysis>false</AllowCodeAnalysis>
<IgnoreThisComponentCompletely>true</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>false</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<DetectStackOverflow>true</DetectStackOverflow>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>60000</DefaultTestTimeout>
<UseBuildConfiguration />
<UseBuildPlatform />
<ProxyProcessPath />
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
</ProjectConfiguration>

2
src/Android/Avalonia.Android/Platform/SkiaPlatform/MainWindowImpl.cs

@ -14,7 +14,7 @@ namespace Avalonia.Android.Platform.SkiaPlatform
{
}
public WindowState WindowState
public new WindowState WindowState
{
get { return WindowState.Normal; }
set { }

2
src/Avalonia.Animation/Avalonia.Animation.csproj

@ -25,6 +25,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\Avalonia.Animation.XML</DocumentationFile>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@ -35,6 +36,7 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Avalonia.Animation.XML</DocumentationFile>
<NoWarn>CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->

1
src/Avalonia.Base/Avalonia.Base.csproj

@ -38,6 +38,7 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Avalonia.Base.XML</DocumentationFile>
<NoWarn>CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Shared\SharedAssemblyInfo.cs">

2
src/Avalonia.Base/Data/InstancedBinding.cs

@ -12,7 +12,7 @@ namespace Avalonia.Data
/// <remarks>
/// Whereas an <see cref="IBinding"/> holds a description of a binding such as "Bind to the X
/// property on a control's DataContext"; this class represents a binding that has been
/// *instanced* by calling <see cref="IBinding.Initiate(IAvaloniaObject, AvaloniaProperty, object)"/>
/// *instanced* by calling <see cref="IBinding.Initiate(IAvaloniaObject, AvaloniaProperty, object, bool)"/>
/// on a target object.
///
/// When a binding is initiated, it can return one of 3 possible sources for the binding:

3
src/Avalonia.Base/Platform/IPlatformThreadingInterface.cs

@ -21,9 +21,6 @@ namespace Avalonia.Platform
/// <returns>An <see cref="IDisposable"/> used to stop the timer.</returns>
IDisposable StartTimer(TimeSpan interval, Action tick);
/// <summary>
/// Sends a message that causes <see cref="ProcessMessage"/> to exit.
/// </summary>
void Signal();
bool CurrentThreadIsLoopThread { get; }

1
src/Avalonia.Base/PriorityBindingEntry.cs

@ -21,7 +21,6 @@ namespace Avalonia
/// <param name="index">
/// The binding index. Later bindings should have higher indexes.
/// </param>
/// <param name="validation">The validation settings for the binding.</param>
public PriorityBindingEntry(PriorityLevel owner, int index)
{
_owner = owner;

6
src/Avalonia.Controls/AppBuilderBase.cs

@ -9,9 +9,9 @@ using Avalonia.Platform;
namespace Avalonia.Controls
{
/// <summary>
/// Initializes up platform-specific services for an <see cref="Application"/>.
/// Base class for initializing platform-specific services for an <see cref="Application"/>.
/// </summary>
/// <typeparam name="TAppBuilder"></typeparam>
/// <typeparam name="TAppBuilder">The type of the AppBuilder class itself.</typeparam>
public abstract class AppBuilderBase<TAppBuilder> where TAppBuilder : AppBuilderBase<TAppBuilder>, new()
{
/// <summary>
@ -140,6 +140,7 @@ namespace Avalonia.Controls
/// Specifies a windowing subsystem to use.
/// </summary>
/// <param name="initializer">The method to call to initialize the windowing subsystem.</param>
/// <param name="name">The name of the windowing subsystem.</param>
/// <returns>An <typeparamref name="TAppBuilder"/> instance.</returns>
public TAppBuilder UseWindowingSubsystem(Action initializer, string name = "")
{
@ -159,6 +160,7 @@ namespace Avalonia.Controls
/// Specifies a rendering subsystem to use.
/// </summary>
/// <param name="initializer">The method to call to initialize the rendering subsystem.</param>
/// <param name="name">The name of the rendering subsystem.</param>
/// <returns>An <typeparamref name="TAppBuilder"/> instance.</returns>
public TAppBuilder UseRenderingSubsystem(Action initializer, string name = "")
{

1
src/Avalonia.Controls/Avalonia.Controls.csproj

@ -38,6 +38,7 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Avalonia.Controls.XML</DocumentationFile>
<NoWarn>CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Shared\SharedAssemblyInfo.cs">

5
src/Avalonia.Controls/Generators/TreeItemContainerGenerator.cs

@ -124,11 +124,6 @@ namespace Avalonia.Controls.Generators
return false;
}
/// <summary>
/// Gets the data template for the specified item.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>The template.</returns>
private ITreeDataTemplate GetTreeDataTemplate(object item, IDataTemplate primary)
{
var template = Owner.FindDataTemplate(item, primary) ?? FuncDataTemplate.Default;

3
src/Avalonia.Controls/HotkeyManager.cs

@ -30,8 +30,9 @@ namespace Avalonia.Controls
public void Execute(object parameter) => GetCommand()?.Execute(parameter);
//Implementation isn't needed in this case
#pragma warning disable CS0067 // Event not used
public event EventHandler CanExecuteChanged;
#pragma warning restore CS0067
}

1
src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj

@ -38,6 +38,7 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Avalonia.Diagnostics.XML</DocumentationFile>
<NoWarn>CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->

22
src/Avalonia.DotNetFrameworkRuntime/AppBuilder.cs

@ -1,27 +1,39 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Avalonia.Controls;
using Avalonia.Platform;
using Avalonia.Shared.PlatformSupport;
using System.IO;
namespace Avalonia
{
/// <summary>
/// Initializes platform-specific services for an <see cref="Application"/>.
/// </summary>
public sealed class AppBuilder : AppBuilderBase<AppBuilder>
{
public AppBuilder() : base(new StandardRuntimePlatform(), () => StandardRuntimePlatformServices.Register())
/// <summary>
/// Initializes a new instance of the <see cref="AppBuilder"/> class.
/// </summary>
public AppBuilder()
: base(new StandardRuntimePlatform(), () => StandardRuntimePlatformServices.Register())
{
}
/// <summary>
/// Initializes a new instance of the <see cref="AppBuilder"/> class.
/// </summary>
/// <param name="app">The <see cref="Application"/> instance.</param>
public AppBuilder(Application app) : this()
{
Instance = app;
}
/// <summary>
/// Instructs the <see cref="AppBuilder"/> to use the best settings for the platform.
/// </summary>
/// <returns>An <see cref="AppBuilder"/> instance.</returns>
public AppBuilder UsePlatformDetect()
{
var os = RuntimePlatform.GetRuntimeInfo().OperatingSystem;

1
src/Avalonia.DotNetFrameworkRuntime/Avalonia.DotNetFrameworkRuntime.csproj

@ -31,6 +31,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Avalonia.DotNetFrameworkRuntime.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

1
src/Avalonia.Input/Avalonia.Input.csproj

@ -38,6 +38,7 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Avalonia.Input.XML</DocumentationFile>
<NoWarn>CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->

1
src/Avalonia.Interactivity/Avalonia.Interactivity.csproj

@ -38,6 +38,7 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Avalonia.Interactivity.XML</DocumentationFile>
<NoWarn>CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->

1
src/Avalonia.Layout/Avalonia.Layout.csproj

@ -38,6 +38,7 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Avalonia.Layout.XML</DocumentationFile>
<NoWarn>CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->

3
src/Avalonia.Logging.Serilog/Avalonia.Logging.Serilog.csproj

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
@ -34,6 +34,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Avalonia.Logging.Serilog.XML</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Compile Include="SerilogLogger.cs" />

12
src/Avalonia.Logging.Serilog/SerilogLogger.cs

@ -8,21 +8,33 @@ using SerilogLogEventLevel = Serilog.Events.LogEventLevel;
namespace Avalonia.Logging.Serilog
{
/// <summary>
/// Sends log output to serilog.
/// </summary>
public class SerilogLogger : ILogSink
{
private readonly ILogger _output;
private readonly Dictionary<string, ILogger> _areas = new Dictionary<string, ILogger>();
/// <summary>
/// Initializes a new instance of the <see cref="SerilogLogger"/> class.
/// </summary>
/// <param name="output">The serilog logger to use.</param>
public SerilogLogger(ILogger output)
{
_output = output;
}
/// <summary>
/// Initializes the Avalonia logging with a new instance of a <see cref="SerilogLogger"/>.
/// </summary>
/// <param name="output">The serilog logger to use.</param>
public static void Initialize(ILogger output)
{
Logger.Sink = new SerilogLogger(output);
}
/// <inheritdoc/>
public void Log(
AvaloniaLogEventLevel level,
string area,

1
src/Avalonia.SceneGraph/Avalonia.SceneGraph.csproj

@ -38,6 +38,7 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Avalonia.SceneGraph.XML</DocumentationFile>
<NoWarn>CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->

24
src/Avalonia.SceneGraph/Media/DrawingContext.cs

@ -208,6 +208,9 @@ namespace Avalonia.Media
/// Pushes an opacity mask.
/// </summary>
/// <param name="mask">The opacity mask.</param>
/// <param name="bounds">
/// The size of the brush's target area. TODO: Are we sure this is needed?
/// </param>
/// <returns>A disposable to undo the opacity mask.</returns>
public PushedState PushOpacityMask(IBrush mask, Rect bounds)
{
@ -216,15 +219,24 @@ namespace Avalonia.Media
}
/// <summary>
/// Pushes a matrix transformation.
/// Pushes a matrix post-transformation.
/// </summary>
/// <param name="matrix">The matrix</param>
/// <returns>A disposable used to undo the transformation.</returns>
public PushedState PushPostTransform(Matrix matrix) => PushSetTransform(CurrentTransform*matrix);
/// <summary>
/// Pushes a matrix pre-transformation.
/// </summary>
/// <param name="matrix">The matrix</param>
/// <returns>A disposable used to undo the transformation.</returns>
public PushedState PushPreTransform(Matrix matrix) => PushSetTransform(matrix*CurrentTransform);
/// <summary>
/// Sets the current matrix transformation.
/// </summary>
/// <param name="matrix">The matrix</param>
/// <returns>A disposable used to undo the transformation.</returns>
PushedState PushSetTransform(Matrix matrix)
{
var oldMatrix = CurrentTransform;
@ -233,7 +245,10 @@ namespace Avalonia.Media
return new PushedState(this, PushedState.PushedStateType.Matrix, oldMatrix);
}
/// <summary>
/// Pushes a new transform context.
/// </summary>
/// <returns>A disposable used to undo the transformation.</returns>
public PushedState PushTransformContainer()
{
_transformContainers.Push(new TransformContainer(CurrentTransform, _currentContainerTransform));
@ -242,6 +257,9 @@ namespace Avalonia.Media
return new PushedState(this, PushedState.PushedStateType.MatrixContainer);
}
/// <summary>
/// Disposes of any resources held by the <see cref="DrawingContext"/>.
/// </summary>
public void Dispose()
{
while (_states.Count != 0)

1
src/Avalonia.SceneGraph/Media/Imaging/RenderTargetBitmap.cs

@ -4,6 +4,7 @@
using System;
using Avalonia.Platform;
using Avalonia.Rendering;
using Avalonia.VisualTree;
namespace Avalonia.Media.Imaging
{

1
src/Avalonia.SceneGraph/Media/MatrixTransform.cs

@ -2,6 +2,7 @@
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using Avalonia.VisualTree;
namespace Avalonia.Media
{

1
src/Avalonia.SceneGraph/Media/RotateTransform.cs

@ -2,6 +2,7 @@
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using Avalonia.VisualTree;
namespace Avalonia.Media
{

1
src/Avalonia.SceneGraph/Media/ScaleTransform.cs

@ -2,6 +2,7 @@
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using Avalonia.VisualTree;
namespace Avalonia.Media
{

1
src/Avalonia.SceneGraph/Media/Transform.cs

@ -3,6 +3,7 @@
using System;
using Avalonia.Animation;
using Avalonia.VisualTree;
namespace Avalonia.Media
{

1
src/Avalonia.SceneGraph/Media/TranslateTransform.cs

@ -2,6 +2,7 @@
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using System;
using Avalonia.VisualTree;
namespace Avalonia.Media
{

1
src/Avalonia.Styling/Avalonia.Styling.csproj

@ -38,6 +38,7 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Avalonia.Styling.XML</DocumentationFile>
<NoWarn>CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Shared\SharedAssemblyInfo.cs">

6
src/Avalonia.Styling/Styling/SelectorMatch.cs

@ -6,12 +6,12 @@ using System;
namespace Avalonia.Styling
{
/// <summary>
/// Holds the result of a <see cref="FuncSelector"/> match.
/// Holds the result of a <see cref="Selector"/> match.
/// </summary>
/// <remarks>
/// There are two types of selectors - ones whose match can never change for a particular
/// control (such as <see cref="Selectors.OfType{T}(FuncSelector)"/>) and ones whose result can
/// change over time (such as <see cref="Selectors.Class(FuncSelector, string)"/>. For the first
/// control (such as <see cref="Selectors.OfType(Selector, Type)"/>) and ones whose result can
/// change over time (such as <see cref="Selectors.Class(Selector, string)"/>. For the first
/// category of selectors, the value of <see cref="ImmediateResult"/> will be set but for the
/// second, <see cref="ImmediateResult"/> will be null and <see cref="ObservableResult"/> will
/// hold an observable which tracks the match.

1
src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj

@ -36,6 +36,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Avalonia.Themes.Default.XML</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->

2
src/Gtk/Avalonia.Gtk/EmbeddableImpl.cs

@ -14,7 +14,9 @@ namespace Avalonia.Gtk
{
class EmbeddableImpl : WindowImplBase, IEmbeddableWindowImpl
{
#pragma warning disable CS0067 // Method not used
public event Action LostFocus;
#pragma warning restore CS0067
public EmbeddableImpl(DrawingArea area) : base(area)
{

12
src/Markup/Avalonia.Markup.Xaml/AvaloniaXamlLoader.cs

@ -8,14 +8,14 @@ using System.Reflection;
using System.Text;
using OmniXaml;
using Avalonia.Platform;
using Avalonia.Markup.Xaml.Context;
using Avalonia.Markup.Xaml.Styling;
using OmniXaml.ObjectAssembler;
using Avalonia.Controls;
using Avalonia.Markup.Xaml.Data;
namespace Avalonia.Markup.Xaml
{
using Context;
using Controls;
using Data;
using OmniXaml.ObjectAssembler;
using System.Linq;
/// <summary>
/// Loads XAML for a avalonia application.
/// </summary>
@ -47,7 +47,7 @@ namespace Avalonia.Markup.Xaml
/// </summary>
/// <remarks>
/// TODO: Making this internal for now as I'm not sure that this is the correct
/// thing to do, but its needd by <see cref="StyleInclude"/> to get the URL of
/// thing to do, but its needed by <see cref="StyleInclude"/> to get the URL of
/// the currently loading XAML file, as we can't use the OmniXAML parsing context
/// there. Maybe we need a way to inject OmniXAML context into the objects its
/// constructing?

1
src/Markup/Avalonia.Markup/Avalonia.Markup.csproj

@ -36,6 +36,7 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Avalonia.Markup.XML</DocumentationFile>
<NoWarn>CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Shared\SharedAssemblyInfo.cs">

10
src/Shared/PlatformSupport/AssetLoader.cs

@ -20,6 +20,12 @@ namespace Avalonia.Shared.PlatformSupport
private AssemblyDescriptor _defaultAssembly;
/// <summary>
/// Initializes a new instance of the <see cref="AssetLoader"/> class.
/// </summary>
/// <param name="assembly">
/// The default assembly from which to load assets for which no assembly is specified.
/// </param>
public AssetLoader(Assembly assembly = null)
{
if (assembly == null)
@ -28,6 +34,10 @@ namespace Avalonia.Shared.PlatformSupport
_defaultAssembly = new AssemblyDescriptor(assembly);
}
/// <summary>
/// Sets the default assembly from which to load assets for which no assembly is specified.
/// </summary>
/// <param name="assembly">The default assembly.</param>
public void SetDefaultAssembly(Assembly assembly)
{
_defaultAssembly = new AssemblyDescriptor(assembly);

1
src/Windows/Avalonia.Direct2D1/Avalonia.Direct2D1.csproj

@ -34,6 +34,7 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Avalonia.Direct2D1.XML</DocumentationFile>
<NoWarn>CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="SharpDX, Version=3.0.2.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">

4
src/Windows/Avalonia.Direct2D1/Media/StreamGeometryImpl.cs

@ -8,7 +8,7 @@ using D2DGeometry = SharpDX.Direct2D1.Geometry;
namespace Avalonia.Direct2D1.Media
{
/// <summary>
/// A Direct2D implementation of a <see cref="StreamGeometry"/>.
/// A Direct2D implementation of a <see cref="Avalonia.Media.StreamGeometry"/>.
/// </summary>
public class StreamGeometryImpl : GeometryImpl, IStreamGeometryImpl
{
@ -56,7 +56,7 @@ namespace Avalonia.Direct2D1.Media
/// Opens the geometry to start defining it.
/// </summary>
/// <returns>
/// A <see cref="StreamGeometryContext"/> which can be used to define the geometry.
/// An <see cref="Avalonia.Platform.IStreamGeometryContextImpl"/> which can be used to define the geometry.
/// </returns>
public IStreamGeometryContextImpl Open()
{

1
src/Windows/Avalonia.Win32/Avalonia.Win32.csproj

@ -36,6 +36,7 @@
<DocumentationFile>bin\Release\Avalonia.Win32.XML</DocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />

2
tests/Avalonia.Controls.UnitTests/Primitives/TabStripTests.cs

@ -19,8 +19,10 @@ namespace Avalonia.Controls.UnitTests.Primitives
{
var items = new[]
{
#pragma warning disable CS0252 // Possible unintended reference comparison; left hand side needs cast
Mock.Of<IHeadered>(x => x.Header == "foo"),
Mock.Of<IHeadered>(x => x.Header == "bar"),
#pragma warning restore CS0252 // Possible unintended reference comparison; left hand side needs cast
};
var target = new TabStrip

2
tests/Avalonia.Styling.UnitTests/TestControlBase.cs

@ -17,7 +17,9 @@ namespace Avalonia.Styling.UnitTests
SubscribeCheckObservable = new TestObservable();
}
#pragma warning disable CS0067 // Event not used
public event EventHandler<AvaloniaPropertyChangedEventArgs> PropertyChanged;
#pragma warning restore CS0067
public string Name { get; set; }

Loading…
Cancel
Save