stuff
This commit is contained in:
@@ -7,12 +7,12 @@
|
||||
|
||||
public abstract class PasswordManagerForm : Form
|
||||
{
|
||||
protected abstract ComboBox ProfileSelection { get; }
|
||||
protected abstract PasswordListBox ResultList { get; }
|
||||
protected abstract TextBox SearchBox { get; }
|
||||
protected abstract Button AddProfile { get; }
|
||||
protected abstract Button DeleteProfile { get; }
|
||||
protected abstract Button GeneratePassword { get; }
|
||||
protected abstract ComboBox ProfileSelection { get; set; }
|
||||
protected abstract PasswordListBox ResultList { get; set; }
|
||||
protected abstract TextBox SearchBox { get; set; }
|
||||
protected abstract Button AddProfile { get; set; }
|
||||
protected abstract Button DeleteProfile { get; set; }
|
||||
protected abstract Button GeneratePassword { get; set; }
|
||||
|
||||
public abstract event ProfileDataRequest CurrentProfilePathRequest;
|
||||
public abstract event ProfileDataRequest CurrentProfileNameRequest;
|
||||
@@ -21,41 +21,8 @@
|
||||
public abstract event Save SaveRequest;
|
||||
public abstract event NewProfile NewProfileRequest;
|
||||
|
||||
public PasswordManagerForm(
|
||||
ProfileDataRequest CurrentProfileNameRequest,
|
||||
ProfileDataRequest CurrentProfilePathRequest,
|
||||
ProfileList CurrentProfileListRequest,
|
||||
ProfileChange CurrentProfileChanged,
|
||||
Save SaveRequest,
|
||||
NewProfile NewProfileRequest)
|
||||
{
|
||||
this.CurrentProfileNameRequest = CurrentProfileNameRequest;
|
||||
this.CurrentProfilePathRequest = CurrentProfilePathRequest;
|
||||
this.CurrentProfileListRequest = CurrentProfileListRequest;
|
||||
this.CurrentProfileChanged = CurrentProfileChanged;
|
||||
this.SaveRequest = SaveRequest;
|
||||
this.NewProfileRequest = NewProfileRequest;
|
||||
}
|
||||
|
||||
protected virtual void ChangeProfile(object sender, EventArgs e)
|
||||
{
|
||||
CurrentProfileChanged(ProfileSelection.Text);
|
||||
}
|
||||
|
||||
public virtual void RefreshCurrentProfile()
|
||||
{
|
||||
ProfileSelection.SelectedIndex = -1;
|
||||
string[] items = CurrentProfileListRequest();
|
||||
for (int i = 0; i < items.Length; i++)
|
||||
{
|
||||
ProfileSelection.Items.Add(items[i]);
|
||||
if (items[i] == CurrentProfileNameRequest())
|
||||
{
|
||||
ProfileSelection.SelectedIndex = i;
|
||||
}
|
||||
}
|
||||
this.Text = CurrentProfileNameRequest();
|
||||
ResultList.ReloadResults();
|
||||
}
|
||||
protected abstract void ChangeProfile(object sender, EventArgs e);
|
||||
public abstract void RefreshCurrentProfile();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user