private void editPropertiesToolStripMenuItem_Click(object sender, EventArgs e) { EUListItem listItem = (EUListItem)LibraryContentDataGridView.SelectedRows[0].Tag; EUFolder folder = SelectedFolder as EUFolder; List <EUContentType> contentTypes = SharePointManager.GetContentTypes(folder.SiteSetting, folder.WebUrl, folder.ListName); EUFieldCollection fields = SharePointManager.GetFields(folder.SiteSetting, folder.WebUrl, folder.ListName); ListItemEditForm listItemEditForm = new ListItemEditForm(); listItemEditForm.InitializeForm(folder, listItem); listItemEditForm.ShowDialog(); if (listItemEditForm.DialogResult != DialogResult.OK) { return; } Hashtable changedProperties = new Hashtable(); if (listItemEditForm.FieldInformations.ContentType != null) { changedProperties.Add("ContentType", listItemEditForm.FieldInformations.ContentType.Name); } for (int i = 0; i < listItemEditForm.FieldInformations.Count(); i++) { changedProperties.Add(listItemEditForm.FieldInformations[i].InternalName, listItemEditForm.FieldInformations[i].Value); } SharePointManager.UpdateListItem(listItem.SiteSetting, listItem.WebURL, listItem.ListName, listItem.ID, changedProperties); RefreshViewExt(); }
private void pictureBox1_Click(object sender, EventArgs e) { EUFolder folder = SelectedFolder as EUFolder; if (folder == null) { return; } EUFieldCollection fields = SharePointManager.GetFields(folder.SiteSetting, folder.WebUrl, folder.ListName); ListFiltersForm listFiltersForm = new ListFiltersForm(); listFiltersForm.InitializeForm(fields, CustomFilters); listFiltersForm.ShowDialog(); if (listFiltersForm.DialogResult == DialogResult.OK) { CustomFilters = listFiltersForm.CustomFilters; RefreshViewExt(); } }
public void InitializeForm(EUFieldCollection fields, EUCamlFilters filters) { Fields = fields; foreach (EUField field in Fields) { if (field.Type == EUFieldTypes.Choice || field.Type == EUFieldTypes.Lookup || field.Type == EUFieldTypes.Number || field.Type == EUFieldTypes.Text) { FieldsComboBox.Items.Add(field); } } if (FieldsComboBox.Items.Count > 0) { FieldsComboBox.SelectedIndex = 0; } if (filters != null) { CustomFilters = filters.Clone(); } BindGrid(CustomFilters); }
public static void UploadEmail(SharePointListViewControl listviewControl, ISPCFolder dragedFolder, DragEventArgs e, List <EUEmailUploadFile> emailUploadFiles, bool isListItemAndAttachmentMode) { try { EUFieldInformations fieldInformations = null; EUFieldCollection fields = null; UploadProgressForm uploadProgressForm = new UploadProgressForm(); if (EUSettingsManager.GetInstance().Settings == null) { MessageBox.Show("You need to configure settings first."); SettingsForm settingsControl = new SettingsForm(); settingsControl.ShowDialog(); return; } if (dragedFolder as EUFolder != null) { EUFolder dragedSPFolder = dragedFolder as EUFolder; List <EUContentType> contentTypes = SharePointManager.GetContentTypes(dragedSPFolder.SiteSetting, dragedSPFolder.WebUrl, dragedSPFolder.ListName); fields = SharePointManager.GetFields(dragedSPFolder.SiteSetting, dragedSPFolder.WebUrl, dragedSPFolder.ListName); ListItemEditForm listItemEditForm = new ListItemEditForm(); listItemEditForm.InitializeForm(dragedSPFolder, null); listItemEditForm.ShowDialog(); if (listItemEditForm.DialogResult != DialogResult.OK) { return; } foreach (EUEmailUploadFile emailUploadFile in emailUploadFiles) { emailUploadFile.FieldInformations = listItemEditForm.FieldInformations; } } string sourceFolder = EUSettingsManager.GetInstance().CreateATempFolder(); if (EUSettingsManager.GetInstance().Settings.UploadAutomatically == true || dragedFolder as FSFolder != null || dragedFolder as GFolder != null) { if (listviewControl != null) { for (int i = 0; i < emailUploadFiles.Count; i++) { EUEmailUploadFile emailUploadFile = emailUploadFiles[i]; listviewControl.LibraryContentDataGridView.Rows.Insert(i, 1); listviewControl.LibraryContentDataGridView.Rows[i].Tag = emailUploadFile.UniqueID.ToString(); if (dragedFolder as EUFolder != null) { listviewControl.LibraryContentDataGridView.Rows[i].Cells["ExtensionImageColumn"].Value = Sobiens.Office.SharePointOutlookConnector.Properties.Resources.ajax_loader; } string title = emailUploadFile.FilePath.Split('\\')[emailUploadFile.FilePath.Split('\\').Length - 1]; listviewControl.LibraryContentDataGridView.Rows[i].Cells["TitleColumn"].Value = title; } } // JOEL JEFFERY 20110712 Hook up the UploadFailed event // JON SILVER JULY 2011 Hook up the UploadSucceeded event if (!addedEventHandler) { OutlookConnector.GetConnector(dragedFolder.SiteSetting).UploadFailed += new EventHandler(EUEmailManager_UploadFailed); OutlookConnector.GetConnector(dragedFolder.SiteSetting).UploadSucceeded += new EventHandler(EUEmailManager_UploadSucceeded); addedEventHandler = true; } OutlookConnector.GetConnector(dragedFolder.SiteSetting).UploadFiles(dragedFolder, emailUploadFiles, fields, fieldInformations, listviewControl); } else { uploadProgressForm.Initialize(dragedFolder, sourceFolder, emailUploadFiles, isListItemAndAttachmentMode, fieldInformations); uploadProgressForm.ShowDialog(); } } catch (System.Exception ex) { string methodName = System.Reflection.MethodBase.GetCurrentMethod().Name; LogManager.LogAndShowException(methodName, ex); throw ex; } }
/// <summary> /// Copies or moves the email to folder. /// </summary> /// <param name="format">The format.</param> private void CopyOrMoveEmailToFolder(SaveFormatOverride format) // JOEL JEFFERY 20110708 added SaveFormatOverride format { if (DragDropTargetNode == null) { return; } EUFolder dragedFolder = DragDropTargetNode.Tag as EUFolder; if (dragedFolder == null) { return; } SharePointListViewControl sharePointListViewControl = GetCurrentSharePointExplorerPane().sharePointListViewControl; if (sharePointListViewControl.SelectedFolder == null || sharePointListViewControl.SelectedFolder.UniqueIdentifier != dragedFolder.UniqueIdentifier || sharePointListViewControl.SelectedFolder.Title != dragedFolder.Title) { sharePointListViewControl = null; } emailItems = new List <MailItem>(); if (DragDropArgs.Data.GetDataPresent("RenPrivateSourceFolder") == false) // if it's not a folder??? { // JON SILVER SAYS... I've never been able to get this bit to fire... therefore under exactly what circumstances would e.Data.GetDataPresent("RenPrivateSourceFolder") == false ?? emailItems.Add(Application.ActiveExplorer().Selection[1] as Outlook.MailItem); } else { // JON SILVER SAYS... we always seem to end up here regardless of what's dropped for (int i = 0; i < Application.ActiveExplorer().Selection.Count; i++) { Outlook.MailItem item = Application.ActiveExplorer().Selection[i + 1] as Outlook.MailItem; emailItems.Add(item); } } bool isListItemAndAttachmentMode = false; EUFieldInformations fieldInformations = null; EUFieldCollection fields = null; if (dragedFolder as EUFolder != null && ((EUFolder)dragedFolder).IsDocumentLibrary == false) { if (((EUFolder)dragedFolder).EnableAttachments == false) { MessageBox.Show("In order to upload email, you need to enable attachment feature in this list."); return; } isListItemAndAttachmentMode = true; } List <EUEmailUploadFile> emailUploadFiles = CommonManager.GetEmailUploadFiles(emailItems, DragDropArgs, isListItemAndAttachmentMode, format); // JON SILVER JUNE 2011 if (!addedEventHandler) { EUEmailManager.UploadFailed += new EventHandler(SharePointOutlookConnector_UploadFailed); EUEmailManager.UploadSucceeded += new EventHandler(SharePointOutlookConnector_UploadSucceeded); addedEventHandler = true; } // JOEL JEFFERY 20110712 try { // JON SILVER JUNE 2011 EUEmailManager.UploadEmail(sharePointListViewControl, dragedFolder, DragDropArgs, emailUploadFiles, isListItemAndAttachmentMode); } catch (System.Exception ex) { if (UploadFailed != null) { UploadFailed(this, new EventArgs()); } throw ex; } }