// ---------------------------------------------------------------------- public iCS_NavigationMemento Clone() { var newMemento = new iCS_NavigationMemento(); newMemento.CopyFrom(this); return(newMemento); }
// ---------------------------------------------------------------------- // Duplication functionality public void CopyFrom(iCS_NavigationMemento from) { ShowDisplayRootNode = from.ShowDisplayRootNode; ScrollPosition = from.ScrollPosition; GuiScale = from.GuiScale; DisplayRoot = from.DisplayRoot; SelectedObject = from.SelectedObject; }
// ---------------------------------------------------------------------- // Reloads the navigation state of the given IStorage from the forward // history. public void ReloadFromForwardHistory(iCS_IVisualScriptData storage) { if (!HasForwardHistory) { return; } var backwardMemento = new iCS_NavigationMemento(storage); myMementos[myCursor].RestoreState(storage); myMementos[myCursor] = backwardMemento; ++myCursor; }
// ---------------------------------------------------------------------- public bool IsEquivalentTo(iCS_NavigationMemento other) { if (ShowDisplayRootNode != other.ShowDisplayRootNode) { return(false); } if (ScrollPosition != other.ScrollPosition) { return(false); } if (GuiScale != other.GuiScale) { return(false); } if (SelectedObject != other.SelectedObject) { return(false); } if (DisplayRoot != other.DisplayRoot) { return(false); } return(true); }