<PackageReference Include="Relativity.Transfer.Client" Version="7.0.8" />

NodeExtensions

public static class NodeExtensions
using System; namespace Relativity.DataTransfer.Nodes { public static class NodeExtensions { public static bool IsRoot(this INode node) { return IsOfType<IRoot>(node); } public static bool IsDrive(this INode node) { return IsOfType<IDrive>(node); } public static bool IsDirectory(this INode node) { return IsOfType<IDirectory>(node); } public static bool IsFile(this INode node) { return IsOfType<IFile>(node); } public static int CompareTo(this INode thisNode, INode otherNode) { int num = GradeNode(thisNode); int num2 = GradeNode(otherNode); return num2 - num; } private static bool IsOfType<T>(INode node) { return node is T; } private static int GradeNode(INode node) { if (!IsOfType<IFile>(node)) { if (!IsOfType<IDirectory>(node)) { if (!IsOfType<IDrive>(node)) { if (!IsOfType<IRoot>(node)) throw new ArgumentOutOfRangeException("node"); return 4; } return 3; } return 2; } return 1; } } }