Repository navigation
Expand file tree
/
Copy pathViewDefinitionBase.cs
More file actions
54 lines (47 loc) · 1.67 KB
/
Copy pathViewDefinitionBase.cs
File metadata and controls
54 lines (47 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSModuleDevelopment.Format
{
/// <summary>
/// Base class for format definitions
/// </summary>
public abstract class ViewDefinitionBase : IComparable
{
/// <summary>
/// The name of the definition
/// </summary>
public string Name;
/// <summary>
/// The typenames selected by
/// </summary>
public List<string> ViewSelectedByType = new List<string>();
/// <summary>
/// The selectionset to select by
/// </summary>
public List<string> ViewSelectedBySet = new List<string>();
/// <summary>
/// The string representation. Must be overridden by all implementing classes.
/// </summary>
public abstract string TextDefinition { get; set; }
/// <summary>
/// The string representation. Must be overridden by all implementing classes.
/// </summary>
/// <returns>The format string to produce for the format file.</returns>
public abstract override string ToString();
/// <summary>
/// Implement IComparable
/// </summary>
/// <param name="Item">The item to compare the current instance with</param>
/// <returns>1, 0 or -1</returns>
public int CompareTo(object Item)
{
ViewDefinitionBase tempItem = Item as ViewDefinitionBase;
if (tempItem == null)
throw new InvalidOperationException("Comparison is supported only between views!");
return Name.CompareTo(tempItem.Name);
}
}
}