Rev | Line | |
---|
[4876] | 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 = string.IsNullOrEmpty(AtomicOperation.Operator.Name) ?
|
---|
| 24 | AtomicOperation.Operator.ItemName :
|
---|
| 25 | AtomicOperation.Operator.Name;
|
---|
| 26 | } else if (Collection != null) {
|
---|
| 27 | Name = string.Format("{0} Operations", Collection.Count);
|
---|
| 28 | } else {
|
---|
| 29 | Name = "";
|
---|
| 30 | }
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | public bool IsCollection { get { return Collection != null; } }
|
---|
| 34 | public bool IsAtomic { get { return AtomicOperation != null; } }
|
---|
| 35 | public bool IsContext { get { return ExecutionContext != null; } }
|
---|
| 36 | }
|
---|
| 37 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.