Пример #1
0
        private void LsbItems_OnAdd(object sender, Controls.CollectionListBox.CollectionListBoxEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog
            {
                Filter           = "json Files (*.json)|*.json|All Files (*.*)|*.*",
                InitialDirectory = Config.LastOpenedDir
            };

            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string filename = openFileDialog.FileName;
                e.Item = new Fav()
                {
                    FileName = filename
                };
            }
            else
            {
                e.Canceled = true;
            }
        }
Пример #2
0
 private void LbBackups_ItemSelected(object sender, Controls.CollectionListBox.CollectionListBoxEventArgs e)
 {
     _Selected         = e.Item as BackupInfo;
     btRestore.Enabled = true;
 }