Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using HeuristicLab.Common;
|
---|
6 | using HeuristicLab.Core;
|
---|
7 |
|
---|
8 | namespace HeuristicLab.DebugEngine {
|
---|
9 | public class OperationContent : IContent {
|
---|
10 |
|
---|
11 | public IOperation Operation { get; private set; }
|
---|
12 | public OperationCollection Collection { get; private set; }
|
---|
13 | public IAtomicOperation AtomicOperation { get; private set; }
|
---|
14 | public ExecutionContext ExecutionContext { get; private set; }
|
---|
15 | public string Name { get; private set; }
|
---|
16 |
|
---|
17 | public OperationContent(IOperation operation) {
|
---|
18 | Operation = operation;
|
---|
19 | Collection = operation as OperationCollection;
|
---|
20 | AtomicOperation = operation as IAtomicOperation;
|
---|
21 | ExecutionContext = operation as ExecutionContext;
|
---|
22 | if (AtomicOperation != null) {
|
---|
23 | Name = Utils.Name(AtomicOperation);
|
---|
24 | } else if (Collection != null) {
|
---|
25 | Name = string.Format("{0} Operations", Collection.Count);
|
---|
26 | } else {
|
---|
27 | Name = "";
|
---|
28 | }
|
---|
29 | }
|
---|
30 |
|
---|
31 | public bool IsCollection { get { return Collection != null; } }
|
---|
32 | public bool IsAtomic { get { return AtomicOperation != null; } }
|
---|
33 | public bool IsContext { get { return ExecutionContext != null; } }
|
---|
34 | }
|
---|
35 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.