private string GetContentFromXML()
        {
            /*
             * get the complet content
             * 1. get the content of the "<description>"-Tag
             * 2. get the content of the "<eachMainPoint>"-Tag
             * 3. get the content of the "<eachSubPoint>"-Tag
             */

            XMLHelper xmlhelper = XMLHelper.getInstance;

            string specialDescription = xmlhelper.GetSpecialLongDescription(SInter.GetCategory(), SInter.GetSubCategory());

            if (specialDescription.Contains(";"))
            {
                string[] specialDescArray = Regex.Split(specialDescription, ";");
                SetMainPointDesc(specialDescArray[1]);
                SetSubPointDesc(specialDescArray[2]);
                return(specialDescArray[0]);
            }
            else
            {
                //ther musst be a errormessage
                return(specialDescription);
            }
        }
Exemplo n.º 2
0
        private void LoadTreeView()
        {
            /*
             * Load all SmartArts into the TreeViewSmartArt
             */
            XMLHelper     xmlHelper     = XMLHelper.getInstance;
            List <string> allCategories = xmlHelper.ListAllCategries();

            foreach (string category in allCategories)
            {
                List <string> subCategories = new List <string>();
                subCategories = xmlHelper.ListAllSubCategries(category);
                TreeNode[] array = new TreeNode[subCategories.Count];
                int        count = 0;
                foreach (string element in subCategories)
                {
                    TreeNode node = new TreeNode(element);
                    array[count] = node;
                    count++;
                }

                TreeNode treeNode = new TreeNode(xmlHelper.TranslateCategory(category), array);
                treeView1.Nodes.Add(treeNode);
            }
        }
Exemplo n.º 3
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.º 4
0
        private void SmartArtDesc_Click(object sender, RibbonControlEventArgs e)
        {
            XMLHelper xmlHelper = XMLHelper.getInstance;

            xmlHelper.LoadAllSmartArtImagesInHiddenFolder(Globals.ThisAddIn.Application.ActivePresentation);
            ListAllSmartArts box = ListAllSmartArts.GetInstanz;

            box.ShowDialog();
        }
        private string GetSpecialDescription()
        {
            /*
             * 1. look for the CategoryNode
             * 2. if found: look for the SubCategoryNode in the Childnodes
             * 3. get the description
             */
            XMLHelper xmlHelper = XMLHelper.getInstance;

            return(xmlHelper.GetSpecialShortDescription(SInter.GetCategory(), SInter.GetSubCategory()));
        }
        private string GetStart()
        {
            /*
             * get the "descriptionStart" and the "shortDescription" from the xml
             * helper-methode is "GetSpecialDescription"
             */
            XMLHelper xmlHelper        = XMLHelper.getInstance;
            string    descriptionStart = xmlHelper.GetStartDescription();

            return(descriptionStart);
        }