Skip to content

Commit

Permalink
Fixed line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoSuter committed Apr 12, 2016
1 parent 93ad0bf commit 593868b
Show file tree
Hide file tree
Showing 2 changed files with 600 additions and 603 deletions.
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
//-----------------------------------------------------------------------
// <copyright file="ReflectionExtensions.cs" company="NSwag">
// Copyright (c) Rico Suter. All rights reserved.
// </copyright>
// <license>https://github.com/NSwag/NSwag/blob/master/LICENSE.md</license>
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Reflection;

namespace NSwag.CodeGeneration.Infrastructure
//-----------------------------------------------------------------------
// <copyright file="ReflectionExtensions.cs" company="NSwag">
// Copyright (c) Rico Suter. All rights reserved.
// </copyright>
// <license>https://github.com/NSwag/NSwag/blob/master/LICENSE.md</license>
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using System;
using System.Reflection;

namespace NSwag.CodeGeneration.Infrastructure
{
/// <summary>Provides extension methods for reflection.</summary>
public static class ReflectionExtensions
{
public static class ReflectionExtensions
{
/// <summary>Checks whether the given type inherits from the given type name.</summary>
/// <param name="type">The type.</param>
/// <param name="typeName">Name of the type.</param>
/// <returns>true if the type inherits from typeName.</returns>
public static bool InheritsFrom(this Type type, string typeName)
{
var baseType = type.GetTypeInfo().BaseType;
while (baseType != null)
{
if (baseType.Name == typeName)
return true;
baseType = baseType.GetTypeInfo().BaseType;
}
return false;
}
}
}
public static bool InheritsFrom(this Type type, string typeName)
{
var baseType = type.GetTypeInfo().BaseType;
while (baseType != null)
{
if (baseType.Name == typeName)
return true;
baseType = baseType.GetTypeInfo().BaseType;
}
return false;
}
}
}
Loading

0 comments on commit 593868b

Please sign in to comment.