Example #1
0
 /// <summary>
 /// code written by Joy
 /// invokes the frmUploadItemsList user control to the custom taskpane
 /// </summary>
 private void MyAddCustomTaskPane()
 {
     if (Globals.ThisAddIn.frmlistObject == null)
     {
         frmUploadItemsListObject = new frmUploadItemsList();
         Globals.ThisAddIn.frmlistObject = frmUploadItemsListObject;
         Globals.ThisAddIn.myCustomTaskPane = Globals.ThisAddIn.CustomTaskPanes.Add(frmUploadItemsListObject, "ITOPIA");
         Globals.ThisAddIn.myCustomTaskPane.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionFloating;
         Globals.ThisAddIn.myCustomTaskPane.DockPositionChanged += new EventHandler(myCustomTaskPane_DockPositionChanged);
         Globals.ThisAddIn.myCustomTaskPane.Height = 500;
         Globals.ThisAddIn.myCustomTaskPane.Width = 600;
         frmUploadItemsListObject.ShowForm(folderName);
         frmUploadItemsListObject.Show();
     }
     else
     {
         frmUploadItemsListObject = Globals.ThisAddIn.frmlistObject;
         //frmUploadItemsListObject.Refresh();
         //Globals.ThisAddIn.myCustomTaskPane.Control.Refresh();
         frmUploadItemsListObject.lblPleaseWaitMessage.Text = "Please Wait - Uploading Items";
         frmUploadItemsListObject.ShowForm(folderName);
         frmUploadItemsListObject.Show();
     }
 }
Example #2
0
        /// <summary>
        /// code written by Joy
        /// invokes the frmUploadItemsList user control to the custom taskpane
        /// </summary>
        /// <param name="frmlistobject"></param>
        private void MyAddCustomTaskPane(frmUploadItemsList frmlistobject)
        {
            if (Globals.ThisAddIn.frmlistObject == null)
            {
                frmUploadItemsListObject = frmlistobject;
                Globals.ThisAddIn.frmlistObject = frmUploadItemsListObject;
                Globals.ThisAddIn.myCustomTaskPane = Globals.ThisAddIn.CustomTaskPanes.Add(frmUploadItemsListObject, "ITOPIA");
                Globals.ThisAddIn.myCustomTaskPane.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionFloating;
                Globals.ThisAddIn.myCustomTaskPane.DockPositionChanged += new EventHandler(myCustomTaskPane_DockPositionChanged);
                Globals.ThisAddIn.myCustomTaskPane.Height = 500;
                Globals.ThisAddIn.myCustomTaskPane.Width = 600;
                frmUploadItemsListObject.ShowForm(folderName);
                frmUploadItemsListObject.Show();
                Globals.ThisAddIn.CustomTaskPanes[0].Visible = true;
            }
            else
            {
                try
                {

                          Globals.ThisAddIn.frmlistObject.Invoke(new MethodInvoker(delegate
                        {
                            frmUploadItemsListObject = Globals.ThisAddIn.frmlistObject;
                            //frmUploadItemsListObject.Refresh();
                            //Globals.ThisAddIn.myCustomTaskPane.Control.Refresh();
                            frmUploadItemsListObject.ShowForm(folderName);
                            frmUploadItemsListObject.lblPRStatus.Text = "";
                        }));

                }
                catch (Exception ex)
                {

                }
            }
        }