private void btnZetOplopend_Click(object sender, EventArgs e) { if (lbLocaties.SelectedItem != null) { InstellingString selected = (InstellingString)lbLocaties.SelectedItem; if (selected.Standaard) { selected.Sortering = SORTERING.OPLOPEND; MailSAVerTwee.Properties.Settings.Default.LocatieStandaard = selected.SorteringMetPad(); } else if (selected.Anders) { selected.Sortering = SORTERING.OPLOPEND; MailSAVerTwee.Properties.Settings.Default.LocatieAnders = selected.SorteringMetPad(); } else { MailSAVerTwee.Properties.Settings.Default.Locaties.Remove(selected.SorteringMetPad()); selected.Sortering = SORTERING.OPLOPEND; MailSAVerTwee.Properties.Settings.Default.Locaties.Add(selected.SorteringMetPad()); } SaveAndReload(); VulLocaties(); } }
private void btnLocatieZetAnders_Click(object sender, EventArgs e) { if (lbLocaties.SelectedItem != null) { InstellingString selected = (InstellingString)lbLocaties.SelectedItem; String padoudeanders = MailSAVerTwee.Properties.Settings.Default.LocatieAnders; MailSAVerTwee.Properties.Settings.Default.LocatieAnders = selected.SorteringMetPad(); MailSAVerTwee.Properties.Settings.Default.Locaties.Remove(selected.SorteringMetPad()); VoegLocatieToe(SaveManager.Instance.getPadZonderSortering(padoudeanders)); SaveAndReload(); VulLocaties(); } }
private void VoegLocatieToe(String pad) { if (pad != null) { //default is oplopend + InstellingString locatie = getObjectVanPad("+" + pad); //Als het ingevoerde pad niet bestaat, melding geven if (Directory.Exists(locatie.Pad)) { if (locatie.Pad != "") { //Als er nog geen \ achter staat, voeg die toe if (!locatie.Pad.EndsWith(@"\")) { locatie.Pad = locatie.Pad + @"\"; } //Ingevoerde pad moet niet al voorkomen bool staatInLijst = false; //Als het pad gelijk is aan de standaard if (MailSAVerTwee.Properties.Settings.Default.LocatieStandaard == pad) { staatInLijst = true; } //Als het pad gelijk is aan de Anders else if (MailSAVerTwee.Properties.Settings.Default.LocatieAnders == pad) { staatInLijst = true; } //Als het pad gelijk is aan een van de locaties foreach (String gelijk in MailSAVerTwee.Properties.Settings.Default.Locaties) { if (gelijk == locatie.Pad) { staatInLijst = true; } } //Als hij nog niet in de lijst staat, voeg hem dan toe if (!staatInLijst) { MailSAVerTwee.Properties.Settings.Default.Locaties.Add(locatie.SorteringMetPad()); SaveAndReload(); VulLocaties(); } else { MessageBox.Show("Ingevoerd pad: '" + pad + "' staat al in de lijst!", "MailSAVer: Melding", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } else { MessageBox.Show("Ingevoerd pad: '" + pad + "' is niet correct!", "MailSAVer: Melding", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
private void btnLocatieVerwijder_Click(object sender, EventArgs e) { if (lbLocaties.SelectedItem != null) { InstellingString selected = (InstellingString)lbLocaties.SelectedItem; MailSAVerTwee.Properties.Settings.Default.Locaties.Remove(selected.SorteringMetPad()); SaveAndReload(); VulLocaties(); } }