Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset store update #634

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion YamlDotNet.Samples/ConvertYamlToJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
// SOFTWARE.

using System.IO;
using Xunit.Abstractions;
using YamlDotNet.Samples.Helpers;
using YamlDotNet.Serialization;

Expand Down
2 changes: 1 addition & 1 deletion YamlDotNet.Samples/DeserializeObjectGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using Xunit.Abstractions;

using YamlDotNet.Samples.Helpers;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;
Expand Down
1 change: 0 additions & 1 deletion YamlDotNet.Samples/DeserializingMultipleDocuments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

using System.Collections.Generic;
using System.IO;
using Xunit.Abstractions;
using YamlDotNet.Core;
using YamlDotNet.Core.Events;
using YamlDotNet.Samples.Helpers;
Expand Down
1 change: 0 additions & 1 deletion YamlDotNet.Samples/LoadingAYamlStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
// SOFTWARE.

using System.IO;
using Xunit.Abstractions;
using YamlDotNet.RepresentationModel;
using YamlDotNet.Samples.Helpers;

Expand Down
29 changes: 14 additions & 15 deletions YamlDotNet.Samples/SerializeObjectGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
// SOFTWARE.

using System;
using Xunit.Abstractions;
using YamlDotNet.Samples.Helpers;
using YamlDotNet.Serialization;

Expand Down Expand Up @@ -92,33 +91,33 @@ public void Main()
public class Address
{
public string street { get; set; }
public string city { get; set; }
public string state { get; set; }
public string city { get; set; }
public string state { get; set; }
}

public class Receipt
{
public string receipt { get; set; }
public DateTime date { get; set; }
public Customer customer { get; set; }
public Item[] items { get; set; }
public Address bill_to { get; set; }
public Address ship_to { get; set; }
public string specialDelivery { get; set; }
public string receipt { get; set; }
public DateTime date { get; set; }
public Customer customer { get; set; }
public Item[] items { get; set; }
public Address bill_to { get; set; }
public Address ship_to { get; set; }
public string specialDelivery { get; set; }
}

public class Customer
{
public string given { get; set; }
public string given { get; set; }
public string family { get; set; }
}

public class Item
{
public string part_no { get; set; }
public string descrip { get; set; }
public decimal price { get; set; }
public int quantity { get; set; }
public string part_no { get; set; }
public string descrip { get; set; }
public decimal price { get; set; }
public int quantity { get; set; }
}
#pragma warning restore IDE1006 // Naming Styles
}
8 changes: 4 additions & 4 deletions YamlDotNet/Core/ParserExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static T Consume<T>(this IParser parser) where T : ParsingEvent
/// </summary>
/// <typeparam name="T">Type of the <see cref="ParsingEvent"/>.</typeparam>
/// <returns>Returns true if the current event is of type T; otherwise returns null.</returns>
public static bool TryConsume<T>(this IParser parser, [MaybeNullWhen(false)] out T @event) where T : ParsingEvent
public static bool TryConsume<T>(this IParser parser, out T @event) where T : ParsingEvent
{
if (parser.Accept(out @event!))
{
Expand Down Expand Up @@ -86,7 +86,7 @@ public static T Require<T>(this IParser parser) where T : ParsingEvent
/// </summary>
/// <typeparam name="T">Type of the event.</typeparam>
/// <returns>Returns true if the current event is of type <typeparamref name="T"/>. Otherwise returns false.</returns>
public static bool Accept<T>(this IParser parser, [MaybeNullWhen(false)] out T @event) where T : ParsingEvent
public static bool Accept<T>(this IParser parser, out T @event) where T : ParsingEvent
{
if (parser.Current == null)
{
Expand Down Expand Up @@ -129,13 +129,13 @@ public static T Expect<T>(this IParser parser) where T : ParsingEvent
}

[Obsolete("Please use TryConsume<T>(out var evt) instead")]
public static T? Allow<T>(this IParser parser) where T : ParsingEvent
public static T Allow<T>(this IParser parser) where T : ParsingEvent
{
return parser.TryConsume<T>(out var @event) ? @event : default;
}

[Obsolete("Please use Accept<T>(out var evt) instead")]
public static T? Peek<T>(this IParser parser) where T : ParsingEvent
public static T Peek<T>(this IParser parser) where T : ParsingEvent
{
return parser.Accept<T>(out var @event) ? @event : default;
}
Expand Down
2 changes: 1 addition & 1 deletion YamlDotNet/Helpers/ExpressionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static PropertyInfo AsProperty(this LambdaExpression propertyAccessor)
return property;
}

private static TMemberInfo? TryGetMemberExpression<TMemberInfo>(LambdaExpression lambdaExpression)
private static TMemberInfo TryGetMemberExpression<TMemberInfo>(LambdaExpression lambdaExpression)
where TMemberInfo : MemberInfo
{
if (lambdaExpression.Parameters.Count != 1)
Expand Down
2 changes: 1 addition & 1 deletion YamlDotNet/Helpers/OrderedDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void RemoveAt(int index)
#pragma warning disable 8767 // Nullability of reference types in type of parameter ... doesn't match implicitly implemented member
#endif

public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value) =>
public bool TryGetValue(TKey key, out TValue value) =>
dictionary.TryGetValue(key, out value);

#if !(NETCOREAPP3_1)
Expand Down
2 changes: 1 addition & 1 deletion YamlDotNet/RepresentationModel/DocumentLoadingState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public YamlNode GetNode(AnchorName anchor, Mark start, Mark end)
/// <param name="anchor">The anchor.</param>
/// <param name="node">The node that was retrieved.</param>
/// <returns>true if the anchor was found; otherwise false.</returns>
public bool TryGetNode(AnchorName anchor, [NotNullWhen(true)] out YamlNode? node)
public bool TryGetNode(AnchorName anchor, out YamlNode? node)
{
return anchors.TryGetValue(anchor, out node);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public sealed class YamlNodeIdentityEqualityComparer : IEqualityComparer<YamlNod
#region IEqualityComparer<YamlNode> Members

/// <summary />
public bool Equals([AllowNull] YamlNode x, [AllowNull] YamlNode y)
public bool Equals(YamlNode x, YamlNode y)
{
return ReferenceEquals(x, y);
}
Expand Down
2 changes: 1 addition & 1 deletion YamlDotNet/Serialization/ITypeInspector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ public interface ITypeInspector
/// found in <paramref name="type"/>
/// </param>
/// <returns></returns>
IPropertyDescriptor GetProperty(Type type, object? container, string name, [MaybeNullWhen(true)] bool ignoreUnmatched);
IPropertyDescriptor GetProperty(Type type, object? container, string name, bool ignoreUnmatched);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public abstract class TypeInspectorSkeleton : ITypeInspector
{
public abstract IEnumerable<IPropertyDescriptor> GetProperties(Type type, object? container);

public IPropertyDescriptor GetProperty(Type type, object? container, string name, [MaybeNullWhen(true)] bool ignoreUnmatched)
public IPropertyDescriptor GetProperty(Type type, object? container, string name, bool ignoreUnmatched)
{
var candidates = GetProperties(type, container)
.Where(p => p.Name == name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void Add(string anchor, object @object)
/// <param name="object">The object.</param>
/// <param name="anchor">The anchor.</param>
/// <returns></returns>
public bool TryGetAnchor(object @object, [MaybeNullWhen(false)] out string? anchor)
public bool TryGetAnchor(object @object, out string? anchor)
{
return anchorsByObject.TryGetValue(@object, out anchor);
}
Expand Down
2 changes: 1 addition & 1 deletion YamlDotNet/Serialization/YamlAttributeOverrides.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public int Matches(Type matchType)

private readonly Dictionary<AttributeKey, List<AttributeMapping>> overrides = new Dictionary<AttributeKey, List<AttributeMapping>>();

public T? GetAttribute<T>(Type type, string member) where T : Attribute
public T GetAttribute<T>(Type type, string member) where T : Attribute
{
if (overrides.TryGetValue(new AttributeKey(typeof(T), member), out var mappings))
{
Expand Down