private static void SetFirstLink(UndoableNawArray list, UndoLink first, bool setCurrentUndoLink = true) { var firstProp = list.GetType().GetField("_first", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); firstProp.SetValue(list, first); if (setCurrentUndoLink) { SetCurrentUndoLink(list, first); } }
private static void SetCurrentUndoLink(UndoableNawArray list, UndoLink currentUndoLink) { var currentProp = list.GetType().GetField("_currentUndoLink", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); currentProp.SetValue(list, currentUndoLink); }
private static void SetCurrentUndoLink(UndoableNawArray list, UndoLink currentUndoLink) { var currentProp = list.GetType().GetProperty("Current"); currentProp.SetValue(list, currentUndoLink); }