Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.DebugEngine/OperationContent.cs @ 4891

Last change on this file since 4891 was 4876, checked in by epitzer, 14 years ago

Complete overhaul of DebugEngine (#47)

File size: 1.3 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.Common;
6using HeuristicLab.Core;
7
8namespace 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.