internal void AddSpline() { Spline spline = new Spline(); EditorData.SplineList.Add(spline); EditorData.InitializeSplineAfterCreation(spline); // Refresh tree view after InitializeSplineAfterCreation // so that the new Spline has a name AppCommands.Self.Gui.RefreshTreeView(); AppState.Self.CurrentSpline = spline; }
internal void DuplicateSpline() { var whatToCopy = AppState.Self.CurrentSpline; if (whatToCopy != null) { var newSpline = AppState.Self.CurrentSpline.Clone(); var casted = EditorData.SplineList.Cast <INameable>(); EditorData.SplineList.Add(newSpline); EditorData.InitializeSplineAfterCreation(newSpline); // Refresh tree view after InitializeSplineAfterCreation // so that the new Spline has a name AppCommands.Self.Gui.RefreshTreeView(); AppState.Self.CurrentSpline = newSpline; } }