1
0
mirror of synced 2024-12-01 02:27:22 +01:00

Some error fixes

This commit is contained in:
KillzXGaming 2020-09-12 16:50:05 -04:00
parent f227f30e04
commit 39910a721b
2 changed files with 9 additions and 3 deletions

View File

@ -866,6 +866,8 @@ namespace LayoutBXLYT
public class UserData : SectionCommon public class UserData : SectionCommon
{ {
public bool Edited = false;
public List<UserDataEntry> Entries { get; set; } public List<UserDataEntry> Entries { get; set; }
public UserData() public UserData()

View File

@ -116,12 +116,12 @@ namespace LayoutBXLYT
bool IsEdited = EditData(); bool IsEdited = EditData();
if (IsEdited) if (IsEdited)
{ {
ActiveUserData.Edited = true;
ActiveUserData.Entries.Add(userDataNew); ActiveUserData.Entries.Add(userDataNew);
LoadUserData(userDataNew); LoadUserData(userDataNew);
} }
} }
private bool EditData() private bool EditData()
{ {
if (SelectedEntry != null) if (SelectedEntry != null)
{ {
@ -155,9 +155,11 @@ namespace LayoutBXLYT
if (parser.Type == UserDataType.String) if (parser.Type == UserDataType.String)
SelectedEntry.SetValue(parser.GetStringASCII()); SelectedEntry.SetValue(parser.GetStringASCII());
if (ActiveUserData == null) if (ActiveUserData == null) {
ActiveUserData = activePane.CreateUserData(); ActiveUserData = activePane.CreateUserData();
}
ActiveUserData.Edited = true;
LoadUserData(activePane, ActiveUserData); LoadUserData(activePane, ActiveUserData);
return true; return true;
} }
@ -172,8 +174,10 @@ namespace LayoutBXLYT
int index = listViewCustom1.SelectedIndices[0]; int index = listViewCustom1.SelectedIndices[0];
listViewCustom1.Items.RemoveAt(index); listViewCustom1.Items.RemoveAt(index);
if (ActiveUserData != null) if (ActiveUserData != null) {
ActiveUserData.Entries.RemoveAt(index); ActiveUserData.Entries.RemoveAt(index);
ActiveUserData.Edited = true;
}
} }
} }