Beispiel #1
0
        private void LoadExemplars()
        {
            if (!File.Exists("list.sav"))
            {
                return;
            }

            ExemplarInfo[] array = null;
            Run
            (
                () =>
            {
                array = SerializationUtility
                        .RestoreArrayFromFile <ExemplarInfo>("list.sav");
            }
            );

            if (ReferenceEquals(array, null))
            {
                return;
            }

            ExemplarList.Clear();
            _bindingSource.SuspendBinding();
            foreach (ExemplarInfo exemplar in array)
            {
                ExemplarList.Add(exemplar);
            }
            _bindingSource.ResumeBinding();
        }
Beispiel #2
0
 private void _clearButton_Click
 (
     object sender,
     EventArgs e
 )
 {
     ExemplarList.Clear();
     SaveExemplars();
 }