Esempio n. 1
0
 /// <summary>
 /// Initialize the form
 /// Write the current location of the settingsfile to the textbox
 /// </summary>
 /// <param name="s">Settingsproperty by reference</param>
 public SettingsForm(ref Settings s)
 {
     InitializeComponent();
     userSettings = s;
     if (!userSettings.ContactsFile.Equals(""))
         txtSettingsFileLocation.Text = userSettings.ContactsFile;
 }
Esempio n. 2
0
        /// <summary>
        /// Initialize the mainform
        /// Create a listcompare
        /// Check if the file with contactinformation exists
        /// </summary>
        public MainForm()
        {
            userSettings = new Settings();
            InitializeComponent();

            contactCompare = new ListCompare();
            listContacts.ListViewItemSorter = contactCompare;

            if (File.Exists(userSettings.ContactsFile))
                listContacts = FileFunctions.readFile(ref contactlist, ref listContacts, userSettings.ContactsFile);
            else {
                MessageBox.Show("File " + userSettings.ContactsFile + " Does not exist.\n\rList of contacts will be empty.");
                menuNewContact_Click(null, null);
            }
            contactlist.Updated = false;
        }