private void btnAdd_Click(object sender, RoutedEventArgs e) {
			var folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
			if (folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
				var newFolder = new FolderLink() {
					Path = folderBrowserDialog.SelectedPath
				};

				if (UserSettingStorage.Instance.FolderLinks == null) {
					UserSettingStorage.Instance.FolderLinks = new List<FolderLink>();
				}

				UserSettingStorage.Instance.FolderLinks.Add(newFolder);
				UserSettingStorage.Instance.Save();
			}

			lbxFolders.Items.Refresh();
		}
Ejemplo n.º 2
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            var folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();

            if (folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                var newFolder = new Wox.Infrastructure.Storage.UserSettings.FolderLink()
                {
                    Path = folderBrowserDialog.SelectedPath
                };

                if (UserSettingStorage.Instance.FolderLinks == null)
                {
                    UserSettingStorage.Instance.FolderLinks = new List <FolderLink>();
                }

                UserSettingStorage.Instance.FolderLinks.Add(newFolder);
                UserSettingStorage.Instance.Save();
            }

            lbxFolders.Items.Refresh();
        }