private void EditButton_Click(object sender, RoutedEventArgs e) { BreadcrumbItem selectedItem = bar.SelectedItem as BreadcrumbItem; if (selectedItem == null) { return; } Folder folder = null; selectedItem.Dispatcher.Invoke(DispatcherPriority.Input, new ThreadStart(() => { folder = selectedItem.Tag as Folder; })); if (folder == null || folder.CanUpload() == false) { MessageBox.Show(Languages.Translate("Please select a folder or a library or a list (attachment enabled)")); return; } SiteSetting siteSetting = ConfigurationManager.GetInstance().GetSiteSetting(folder.SiteSettingID); FoldersManager.EditItemPropertyMappings(siteSetting, folder); }
private void FoldersTreeView_Drop(object sender, DragEventArgs e) { TreeViewItem targetItem = GetNearestContainer(e.OriginalSource as UIElement); Folder folder = targetItem.Tag as Folder; if (folder == null && folder.CanUpload() == false) { MessageBox.Show(Languages.Translate("Please drop into a folder or a library or a list(attachment enabled)")); return; } bool canUpdateItemInGrid = false; if (this.ConnectorExplorer.ContentExplorer.SelectedFolder != null && this.ConnectorExplorer.ContentExplorer.SelectedFolder.GetUrl() == folder.GetUrl()) { canUpdateItemInGrid = true; } List <IItem> emailItems = new List <IItem>(); ISiteSetting siteSetting = ConfigurationManager.GetInstance().GetSiteSetting(folder.SiteSettingID); List <UploadItem> uploadItems = ApplicationContext.Current.GetUploadItems(folder.GetWebUrl(), siteSetting, folder, e, getFieldMappings); if (uploadItems == null) { return; } WorkItem workItem = new WorkItem(Languages.Translate("Uploading emails")); workItem.CallbackFunction = new WorkRequestDelegate(UploadEmails_Callback); workItem.CallbackData = new object[] { siteSetting, folder, uploadItems, this.ConnectorExplorer, canUpdateItemInGrid }; workItem.WorkItemType = WorkItem.WorkItemTypeEnum.NonCriticalWorkItem; BackgroundManager.GetInstance().AddWorkItem(workItem); }