Last change
on this file since 6133 was
6133,
checked in by gkronber, 13 years ago
|
#1471: imported generic parts of DataImporter from private code base
|
File size:
1.2 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Xml;
|
---|
6 | using HeuristicLab.DataImporter.Data.Model;
|
---|
7 | using HeuristicLab.DataImporter.Data.CommandBase;
|
---|
8 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
9 |
|
---|
10 | namespace HeuristicLab.DataImporter.Data.Command {
|
---|
11 | [StorableClass]
|
---|
12 | public class RenameColumnCommand : ColumnCommandBase {
|
---|
13 | [Storable]
|
---|
14 | private string newName;
|
---|
15 |
|
---|
16 | private string oldName;
|
---|
17 |
|
---|
18 | private RenameColumnCommand()
|
---|
19 | : base(null, string.Empty, -1) {
|
---|
20 | }
|
---|
21 |
|
---|
22 | public RenameColumnCommand(DataSet dataSet, string columnGroupName, int columnIndex, string newName)
|
---|
23 | : base(dataSet, columnGroupName, columnIndex) {
|
---|
24 | this.newName = newName;
|
---|
25 | }
|
---|
26 |
|
---|
27 | public override string Description {
|
---|
28 | get { return "Rename Column"; }
|
---|
29 | }
|
---|
30 |
|
---|
31 | public override void Execute() {
|
---|
32 | base.Execute();
|
---|
33 | oldName = Column.Name;
|
---|
34 | Column.Name = newName;
|
---|
35 | Column.FireChanged();
|
---|
36 | this.ColumnGroup = null;
|
---|
37 | }
|
---|
38 |
|
---|
39 | public override void UndoExecute() {
|
---|
40 | base.UndoExecute();
|
---|
41 | Column.Name = oldName;
|
---|
42 | oldName = null;
|
---|
43 | Column.FireChanged();
|
---|
44 | this.ColumnGroup = null;
|
---|
45 | }
|
---|
46 | }
|
---|
47 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.