Track if the action collection needs to be saved.

This commit is contained in:
Tim Young 2018-05-11 10:47:31 -05:00
parent 44b26812ed
commit f68e3138f4

View File

@ -12,6 +12,11 @@ namespace EduNetworkBuilder
Network StartingState = null;
public List<NetworkAction> NetActions = new List<NetworkAction>();
NetworkAction CurrentNetAction = null;
bool _HasUnsavedChanges = false;
public bool HasUnsavedChanges {
get { return _HasUnsavedChanges; }
private set { _HasUnsavedChanges = value; }
}
public Network GetNet { get { return StartingState; } }
public int GetActionCount { get { if (CurrentNetAction == null) return 0; return CurrentNetAction.Actions.Count; } }
@ -68,6 +73,8 @@ namespace EduNetworkBuilder
//Add this one
CurrentNetAction.HasBeenStored = true; //Note that we have stored it
NetActions.Add(CurrentNetAction);
//Note that the long-term action list has some new actions which have not been saved
HasUnsavedChanges = true;
}
/// <summary>