/// <summary> /// Custome menu item "Itopia Edit proeprties" click event /// </summary> /// <param name="Ctrl"></param> /// <param name="CancelDefault"></param> void oFolderMenuButtonEditConnectionProperties_Click(Microsoft.Office.Core.CommandBarButton Ctrl, ref bool CancelDefault) { try { try { renameButton.Click -= new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(renameButton_Click); } catch { } //Create instance frmSPSiteConfigurationObject = new frmSPSiteConfiguration(); //Get the drop url string folderName = ((Microsoft.Office.Core.CommandBarButtonClass)(Ctrl)).Tag; frmSPSiteConfigurationObject.ShowEditForm(folderName); if (frmSPSiteConfigurationObject.IsConfigureCompleted) { UserLogManagerUtility.UpdateFolderConfigDetails("", frmSPSiteConfigurationObject.FolderConfigProperties); foreach (MAPIFolderWrapper folder in myFolders) { if (folder.FolderName == folderName) { folder.AttachedFolder.WebViewURL = frmSPSiteConfigurationObject.URL; break; } } } } catch (Exception ex) { EncodingAndDecoding.ShowMessageBox("oFolderMenuButtonConnectionProperties_Click", ex.Message, MessageBoxIcon.Error); } }
/// <summary> /// <c>dgvUsersInformation_CellContentClick</c> Event Handler /// it display <c>frmSPSiteConfiguration</c> window form to update connection properties /// of the selected record /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvUsersInformation_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (e.ColumnIndex == 0) { string foldername = ""; foldername = dgvUsersInformation.Rows[e.RowIndex].Cells[1].Value.ToString(); frmSPSiteConfiguration frmSPSiteConfigurationObject = new frmSPSiteConfiguration(); frmSPSiteConfigurationObject.ShowEditForm(foldername); if (frmSPSiteConfigurationObject.IsConfigureCompleted) { UserLogManagerUtility.UpdateFolderConfigDetails("", frmSPSiteConfigurationObject.FolderConfigProperties); //foreach (MAPIFolderWrapper folder in myFolders) //{ // if (folder.FolderName == folderName) // { // folder.AttachedFolder.WebViewURL = frmSPSiteConfigurationObject.URL; // break; // } //} Microsoft.Office.Interop.Outlook.Application outlookObj = Globals.ThisAddIn.Application; //Gte MAPI Name space Microsoft.Office.Interop.Outlook.NameSpace outlookNameSpace = outlookObj.GetNamespace("MAPI"); Microsoft.Office.Interop.Outlook.MAPIFolder oInBox = outlookNameSpace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox); Microsoft.Office.Interop.Outlook.MAPIFolder parentFolder = (Microsoft.Office.Interop.Outlook.MAPIFolder)oInBox.Parent; Microsoft.Office.Interop.Outlook.MAPIFolder f = MAPIFolderWrapper.GetFolder(parentFolder, foldername); if (f != null) { f.WebViewURL = frmSPSiteConfigurationObject.URL; } } BindGrid(); } } catch (Exception ex) { } }