Пример #1
0
        public void TSCP_Callback_Format(Office.IRibbonControl rib)
        {
            pptfunctions funObj = new pptfunctions();

            if (funObj.TSCThemeLoaded())
            {
                funObj.Format_PPT_Object(rib);
            }
            else
            {
                MessageBox.Show("This functionality works with TSC Theme. Please Load TSC theme and try again. Thanks", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            PPTAttribute.UserTracker(rib);
        }
Пример #2
0
        public void btnInserttable_Click(Office.IRibbonControl rib)
        {
            pptfunctions funObj = new pptfunctions();
            frmtable     tbobj  = new frmtable();

            if (funObj.TSCThemeLoaded())
            {
                tbobj.ShowDialog();
            }
            else
            {
                MessageBox.Show("This functionality works with TSC Theme. Please Load TSC theme and try again. Thanks", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            PPTAttribute.UserTracker(rib);
        }
Пример #3
0
        //Developed by vandna
        public void btnAlignshape_Click(Office.IRibbonControl rib)
        {
            clsAlignObject objAlign = new TSCPPT_Addin.clsAlignObject();
            pptfunctions   funObj   = new pptfunctions();

            if (funObj.TSCThemeLoaded())
            {
                objAlign.funAlignObject(rib);
            }
            else
            {
                MessageBox.Show("This functionality works with TSC Theme. Please Load TSC theme and try again. Thanks", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            PPTAttribute.UserTracker(rib);
        }
Пример #4
0
        //Developed by vandna
        public void btnselectshape_Click(Office.IRibbonControl rib)
        {
            clsSelectObject selObj = new clsSelectObject();
            pptfunctions    funObj = new pptfunctions();

            if (funObj.TSCThemeLoaded())
            {
                selObj.Select_Same_Object(rib);
            }
            else
            {
                MessageBox.Show("This functionality works with TSC Theme. Please Load TSC theme and try again. Thanks", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            PPTAttribute.UserTracker(rib);
        }
Пример #5
0
        public void TSCP_Callback71(Office.IRibbonControl rib)
        {
            pptfunctions      funObj = new pptfunctions();
            frmChangeLanguage lngObj = new frmChangeLanguage();

            if (funObj.TSCThemeLoaded())
            {
                lngObj.ShowDialog();
            }
            else
            {
                MessageBox.Show("This functionality works with TSC Theme. Please Load TSC theme and try again. Thanks", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            PPTAttribute.UserTracker(rib);
        }
Пример #6
0
        public void TSCP_Callback46(Office.IRibbonControl rib)
        {
            pptfunctions funObj = new pptfunctions();

            if (funObj.TSCThemeLoaded())
            {
                frmChartformat chartobj = new frmChartformat();
                chartobj.ShowDialog();
                //funObj.formatChart(tscColors, cDataLabels, cYAxis,rib);
            }
            else
            {
                MessageBox.Show("This functionality works with TSC Theme. Please Load TSC theme and try again. Thanks", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            PPTAttribute.UserTracker(rib);
        }
Пример #7
0
        public void btnRemove_Click(Office.IRibbonControl rib)  //Maksood
        {
            pptfunctions funObj = new pptfunctions();

            clsClean cClean = new clsClean();

            if (funObj.TSCThemeLoaded())
            {
                if (rib.Id == "btnRemoveDoubleSpace")
                {
                    cClean.pRemoveDoubleSpace_Clean();
                }
                else if (rib.Id == "btnRemoveSlideAnimations")
                {
                    cClean.pRemoveAnimation();
                }
                else if (rib.Id == "btnRemove3D_effects")
                {
                    cClean.pRemove3D_Effect();
                }

                else if (rib.Id == "btnRemoveMargin")
                {
                    cClean.pRemoveMargin();
                }
                else if (rib.Id == "btnParagraphSpacing")
                {
                    cClean.setParagraphSpacing();
                }
            }
            else
            {
                MessageBox.Show("This functionality works with TSC Theme. Please Load TSC theme and try again. Thanks", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            PPTAttribute.UserTracker(rib);
        }
Пример #8
0
        public void ChartGalleryOnAction(Office.IRibbonControl rib, string galleryID, int selectedIndex)
        {
            pptfunctions funObj = new pptfunctions();

            if (funObj.TSCThemeLoaded())
            {
                frmChartformat chartobj = new frmChartformat();
                switch (galleryID)
                {
                case "chart1": { funObj.formatChart("item1", rib); break; }

                case "chart2": { funObj.formatChart("item2", rib); break; }

                case "chart3": { funObj.formatChart("item3", rib); break; }

                case "chart4": { funObj.formatChart("item4", rib); break; }
                }
            }
            else
            {
                MessageBox.Show("This functionality works with TSC Theme. Please Load TSC theme and try again. Thanks", PPTAttribute.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            PPTAttribute.UserTracker(rib);
        }
Пример #9
0
        public void btnRemovedraft_Click(Office.IRibbonControl rib)
        {
            pptfunctions obj = new pptfunctions();

            obj.RemoveDraft();
        }
Пример #10
0
        public void btnAdddraft_Click(Office.IRibbonControl rib)
        {
            pptfunctions obj = new pptfunctions();

            obj.InsertDraft();
        }
Пример #11
0
        private void btn_Submit_Click(object sender, EventArgs e)
        {
            pptfunctions funObj       = new pptfunctions();
            PPTActions   actionObj    = new PPTActions();
            Formatshapes PPTshpFormat = new Formatshapes();

            ppApp.DisplayAlerts = PowerPoint.PpAlertLevel.ppAlertsNone;
            try
            {
                if (rbselectedppt.Checked == true)          // Work on Current PPT
                {
                    OpenedPPT.PageSetup.SlideWidth  = 960;
                    OpenedPPT.PageSetup.SlideHeight = 540;
                    ppApp.ActivePresentation.ApplyTheme(PPTAttribute.mPPTPath);
                    funObj.DeleteOldTSCMasters();

                    foreach (PowerPoint.Slide sld in OpenedPPT.Slides)
                    {
                        foreach (PowerPoint.Shape shp in sld.Shapes)
                        {
                            if (shp.Name == "Road Map" || shp.Name == "Title Box" || shp.Name == "Note Box" || shp.Name == "Source Box")
                            {
                                DataTable dt = actionObj.get_specification(shp.Name);
                                FormatShape(sld.SlideIndex, shp.Name, dt);
                            }
                        }
                    }
                    this.Close();
                }
                else if (rbselectedslide.Checked == true)   // Work on Current Slide
                {
                    OpenedPPT.PageSetup.SlideWidth  = 960;
                    OpenedPPT.PageSetup.SlideHeight = 540;
                    ppApp.ActivePresentation.ApplyTheme(PPTAttribute.mPPTPath);
                    funObj.DeleteOldTSCMasters();

                    int sldnum           = ppApp.ActiveWindow.Selection.SlideRange.SlideNumber;
                    PowerPoint.Slide sld = OpenedPPT.Slides[sldnum];
                    foreach (PowerPoint.Shape shp in sld.Shapes)
                    {
                        if (shp.Name == "Road Map" || shp.Name == "Title Box" || shp.Name == "Note Box" || shp.Name == "Source Box")
                        {
                            DataTable dt = actionObj.get_specification(shp.Name);
                            FormatShape(sld.SlideIndex, shp.Name, dt);
                        }
                    }
                    this.Close();
                }
                else if (rbtn_selectfolder.Checked == true)
                {
                    string pathString = System.IO.Path.Combine(selectedFolder, "TSC_PPT_29032018");
                    System.IO.Directory.CreateDirectory(pathString);
                    string pptPath = null, newfilepath = null;
                    int    rowscount = fileGridView.Rows.Count;
                    foreach (DataGridViewRow row in fileGridView.Rows)
                    {
                        //for templated control
                        if (Convert.ToBoolean(row.Cells[2].Value) == true)
                        {
                            string fileName = row.Cells[0].Value.ToString();
                            newfilepath = pathString + "\\" + fileName;
                            pptPath     = selectedFolder + "\\" + fileName;
                            OpenedPPT   = ppApp.Presentations.Open(pptPath);
                            //-- Apply New TSC Theme
                            ppApp.DisplayAlerts             = PowerPoint.PpAlertLevel.ppAlertsNone;
                            OpenedPPT.PageSetup.SlideWidth  = 960;
                            OpenedPPT.PageSetup.SlideHeight = 540;
                            ppApp.ActivePresentation.ApplyTheme(PPTAttribute.mPPTPath);
                            funObj.DeleteOldTSCMasters();
                            // -- Format Slide
                            foreach (PowerPoint.Slide sld in OpenedPPT.Slides)
                            {
                                foreach (PowerPoint.Shape shp in sld.Shapes)
                                {
                                    if (shp.Name == "Road Map" || shp.Name == "Title Box" || shp.Name == "Note Box" || shp.Name == "Source Box")
                                    {
                                        DataTable dt = actionObj.get_specification(shp.Name);
                                        FormatShape(sld.SlideIndex, shp.Name, dt);
                                    }
                                }
                            }
                            row.Cells[1].Value = "Done";
                            OpenedPPT.SaveAs(newfilepath);
                            OpenedPPT.Close();
                            // If Process has been done the update the status Done
                        }
                    } // Close Outer For loop
                    ppApp.DisplayAlerts = PowerPoint.PpAlertLevel.ppAlertsAll;
                }
            }
            catch (Exception err)
            {
                string errtext = err.Message;
                PPTAttribute.ErrorLog(errtext, "Format -All Slide");
            }
        }