Beispiel #1
0
        private void ClickForDesc(string obj)
        {
            ParentElement = masterController.elementController.findElement(obj);

            if (ParentElement.url == true)
            {
                string file = ParentElement.desc;
                if (file.Split('.').Last() == "md")
                {
                    string transformhtml = markdown.Transform(File.ReadAllText(file));
                    file = file.Substring(0, file.LastIndexOf('.'));
                    File.WriteAllText(file + ".html", transformhtml);
                    ParentElement.desc = file + ".html";
                }

                DescUrl = ParentElement.desc;
            }
            else
            {
                Description = markdown.Transform(ParentElement.desc);
            }
            RelevEle      relevEle   = this.masterController.hilfer.relevEles.Find(rE => rE.element.Equals(ParentElement));
            List <string> caListView = new List <string>();

            if (relevEle != null)
            {
                caListView = relevEle.relevantElements;
            }
            SeeAlsoListView = new ListViewViewModel(caListView);
        }
Beispiel #2
0
        public List <string> get_ElementList(Element element)
        {
            if (element is null)
            {
                throw new ArgumentNullException("the element is null");
            }
            RelevEle relevEle = masterController.hilfer.relevEles.Find(r => r.element.Equals(element));

            if (relevEle is null)
            {
                return(null);
            }
            return(relevEle.relevantElements);
        }
Beispiel #3
0
        public void add_Rels(Element ele, List <string> relevEles)
        {
            RelevEle relevEle = masterController.hilfer.relevEles.Find(r => r.element.Equals(ele));

            if (relevEle is null)
            {
                RelevEle rE = new RelevEle(ele, relevEles);
                masterController.hilfer.relevEles.Add(rE);
                return;
            }
            else
            {
                relevEle.relevantElements = relevEles;
            }
        }
Beispiel #4
0
        private Dictionary <string, int> contributionCalculation(List <Element> elements, List <RelevEle> relevEles)
        {
            Dictionary <string, int> contribution = new Dictionary <string, int>();

            foreach (Element item in elements)
            {
                RelevEle rEle  = relevEles.Find(r => r.element.name.Equals(item.name));
                int      count = 0;
                if (rEle != null)
                {
                    count = rEle.relevantElements.Count;
                }
                contribution.Add(item.name, count);
            }
            return(contribution);
        }