Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
TemplateProviderComparerBase.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System.Collections.Generic;
4 
5 namespace SiliconStudio.Presentation.View
6 {
7  /// <summary>
8  /// A base class to compare instances of <see cref="ITemplateProvider"/> in order to determine which template to use when multiple template providers match the same object.
9  /// </summary>
10  public abstract class TemplateProviderComparerBase : IComparer<ITemplateProvider>
11  {
13  {
14  return CompareProviders(x, y);
15  }
16 
17  /// <summary>
18  /// Compares two <see cref="ITemplateProvider"/> to determine which template has the greatest priority.
19  /// </summary>
20  /// <param name="x">The first <see cref="ITemplateProvider"/> to compare.</param>
21  /// <param name="y">The second <see cref="ITemplateProvider"/> to compare.</param>
22  /// <returns><c>-1</c> if <see cref="x"/> has a greater priority than <see cref="y"/>, <c>0</c> if they have the same priority, <c>1</c> if <see cref="y"/> has a greater priority than <see cref="x"/>.</returns>
23  protected abstract int CompareProviders(ITemplateProvider x, ITemplateProvider y);
24  }
25 }
_In_ size_t _In_ DXGI_FORMAT _In_ size_t _In_ float size_t y
Definition: DirectXTexP.h:191
An interface for a class that can provide a template for a given object that matches some prerequisit...
A base class to compare instances of ITemplateProvider in order to determine which template to use wh...