Exemplo n.º 1
0
// i did not find a better way ------------------------

        protected override void OnFormClosed(FormClosedEventArgs e)
        {
            /*
             * the "DescriptionFormManager" have to delet that form from the list
             */

            if (saveStateLabel.ForeColor == System.Drawing.Color.Red)
            {
                var result = MessageBox.Show("Ihre Änderungen wurden nocht nicht gespeichert und gehen automatisch verloren. \n Möchten Sie dennoch die Maske schließen?", "Ohne Speichern schließen", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (result == System.Windows.Forms.DialogResult.Yes)
                {
                    disposHappen = true;
                    DescFormManager formManger = DescFormManager.GetInstanz;
                    formManger.CloseDescForm(GetSubCategory());
                    base.OnFormClosed(e);
                }
                else
                {
                    disposHappen = false;
                    return;
                }
            }
            else
            {
                disposHappen = true;
                DescFormManager formManger = DescFormManager.GetInstanz;
                formManger.CloseDescForm(GetSubCategory());
                base.OnFormClosed(e);
            }
        }
Exemplo n.º 2
0
        private void kontrolleStart_Click(object sender, RibbonControlEventArgs e)
        {
            /*
             * 1. ask "XMLHelper": Does the XML contains all SmartArts?
             * 2.   Yes: Alert: "all ok" and ask for continue
             *      No: Alert: SmartArt which is not found and ask for insert the SmartArt
             */
            XMLHelper controlXML = XMLHelper.getInstance;
            bool      folder     = controlXML.LoadAllSmartArtImagesInHiddenFolder(Globals.ThisAddIn.Application.ActivePresentation);

            while (!(folder == true))
            {
            }
            string[] notExistingDescs = controlXML.XMLContainsAllSmartArts(Globals.ThisAddIn.Application.ActivePresentation);
            //return: a array with the elements: "SlideNr","subCategory","category"
            if (notExistingDescs == null)
            {
                /*
                 * if the XML contains all SmartArts
                 */
                var result = MessageBox.Show("Alle SmartArts besitzen eine Beschreibung. \n Möchten Sie mit der Konvertierung beginnen?",
                                             "Alles da", MessageBoxButtons.YesNo, MessageBoxIcon.Information);

                if (result == DialogResult.Yes)
                {
                    /*
                     * delete the hidden folder and start the process
                     */
                    controlXML.DeleteHiddenFolder(Globals.ThisAddIn.Application.ActivePresentation);
                    Pipeline pipeline = Pipeline.GetInstanz;
                    pipeline.AllSlides(Globals.ThisAddIn.Application.ActivePresentation);
                }
            }
            else
            {
                /*
                 * if the XML does not contain all SmartArts
                 */
                var result = MessageBox.Show("Es fehlen die Beschreibungen für: \n\n" + GetListViewForm(notExistingDescs) + "\n Möchten Sie die fehlende Beschreibungen sofort anlegen?",
                                             "Es fehlt was", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

                if (result == DialogResult.Yes)
                {
                    /*
                     * Open the "DescriptionForm" MessageBox(s)
                     */
                    DescFormManager formManager = DescFormManager.GetInstanz;
                    foreach (string part in notExistingDescs)
                    {
                        String[] eachSmartArtInfo = Regex.Split(part, ",");
                        //eachSmartArtInfo[0] = "SlideNr"
                        //eachSmartArtInfo[1] = "smartArtPerSlide"
                        //eachSmartArtInfo[2] = "subCategory"
                        //eachSmartArtInfo[3] = "category"
                        formManager.GetDescForm(eachSmartArtInfo[3], eachSmartArtInfo[2]);
                    }
                }
            }
        }
Exemplo n.º 3
0
 private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     /*
      * if the user select a SmartArt
      * source: https://msdn.microsoft.com/de-de/library/system.windows.forms.treeview.nodemousedoubleclick(v=vs.110).aspx
      */
     if (e.Node.Level == 1)
     {
         DescFormManager formManager = DescFormManager.GetInstanz;
         formManager.GetDescForm(e.Node.Text);
     }
 }
Exemplo n.º 4
0
        private void deleteDesc_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show("Möchten Sie die gesamte Beschreibung für diese Smartart-Grafik unwiederruflich löschen?", "Beschreibung löschen", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                //Delete the description from XML
                XmlWriter xmlWriter = XmlWriter.GetInstance;
                xmlWriter.DeleteSmartArtDescription(GetCategory(), GetSubCategory());
                //Call "ListAllSmartArts"-Form to reload
                ListAllSmartArts.GetInstanz.ReloadTreeView();
                //Close the window
                disposHappen = true;
                DescFormManager formManger = DescFormManager.GetInstanz;
                formManger.CloseDescForm(GetSubCategory());
                Close();
            }
        }