Ejemplo n.º 1
0
        private static void AddEnteringFrom(StateShadow shadow, XmlElement stateElement)
        {
            List <string> inputList = shadow.GetEnteringFromTargetNames();

            if (inputList.Count == 0)
            {
                return;
            }

            XmlElement listElement = CreateElement(stateElement, xmlStrings.PreviousStateList);

            foreach (string s in inputList)
            {
                XmlElement element = CreateElement(listElement, xmlStrings.StateId);
                element.InnerText = s;
            }
        }
        private static void FillEnteringFrom(Cell cell, StateShadow shadow)
        {
            List<string> list = shadow.GetEnteringFromTargetNames();
            List<string> maxList;

            HashSet<string> uniqueList = new HashSet<string>();
            foreach (string s in list)
                uniqueList.Add(s);
            if (gotoMaxHandlerCache.TryGetValue(shadow.GetStateId(), out maxList))
                foreach (string s in maxList)
                    uniqueList.Add(s);

            list = uniqueList.ToList();

            bool first = true;
            cell.Range.InsertAfter(" ");
            foreach (string enteringFrom in list) {
                if (!first)
                    cell.Range.InsertAfter(", ");
                first = false;

                Selection sel = cell.Application.Selection;
                sel.InsertAfter(enteringFrom);
                sel.set_Style("HyperLink");
                string link = "bm" + Left(AlphaNumericCharsOnly(enteringFrom), 38);
                sel.Document.Hyperlinks.Add(Anchor: sel.Range, SubAddress: link);
                int count = cell.Range.Characters.Count;
                sel.set_Style("TableNormalCell");
                sel.MoveStart(WdUnits.wdWord, -1);
                sel.Cut();
                Range range = cell.Range.Characters[count - 1];
                range.Paste();

            }
        }
Ejemplo n.º 3
0
        private static void AddEnteringFrom(StateShadow shadow, XmlElement stateElement)
        {
            List<string> inputList = shadow.GetEnteringFromTargetNames();
            if (inputList.Count == 0)
                return;

            XmlElement listElement = CreateElement(stateElement, xmlStrings.PreviousStateList);

            foreach (string s in inputList) {
                XmlElement element = CreateElement(listElement, xmlStrings.StateId);
                element.InnerText = s;
            }
        }