Esempio n. 1
0
        private string[] GetFields(IShapeHandler shape)
        {
            if (null == shape.GetProperties()["fields"])
            {
                return(new string[0]);
            }

            string fieldInfo = shape.GetProperties()["fields"].InnerXml;
            int    begin = 0, end = 0, pointer = 0;

            List <string> toReturn = new List <string>();

            while (true)
            {
                begin = fieldInfo.IndexOf("<value>", pointer);

                if (-1 == begin)
                {
                    break;
                }

                pointer = begin;

                end     = fieldInfo.IndexOf("</value>", pointer);
                pointer = end;

                toReturn.Add(fieldInfo.Substring(begin + 7, end - (begin + 7)));
            }
            return(toReturn.ToArray());
        }
Esempio n. 2
0
        private PageReport PaintInvalid(Page page, PageReport report, string mode)
        {
            int       invalidCount  = 0;
            Hashtable shapeHandlers = new Hashtable();

            CgoConfig[] Cgo = CgoConfigs.Search();

            GroupElementTable groupElementTable = new GroupElementTable();
            ElementTable      elementTable      = new ElementTable();

            foreach (Shape shape in page.Shapes)
            {
                string shapeName = VisioUtils.GetProperty(shape, "User", "ScreenShape");
                if (shapeName == null)
                {
                    continue;
                }

                IShapeHandler shapeHandler = GetShapeHandler(shapeHandlers, shape, shapeName, mode);
                if (shape.Data1 == _INVALID)
                {
                    shapeHandler.PaintAsInvalid();
                }
                else
                {
                    if (Cgo != null)
                    {
                        XmlNode shapeProperties = shapeHandler.GetProperties();
                        XmlNode cgoNode         = shapeProperties.SelectSingleNode("cgoName");
                        if (cgoNode != null)
                        {
                            string cgoCode = cgoNode.InnerText;
                            if (!CgoConfigs.Exists(Cgo, cgoCode))
                            {
                            }
                        }
                    }
                }
                invalidCount++;

                string groupElementName = VisioUtils.GetProperty(shape, "Prop", "Group");
                string elementName      = VisioUtils.GetProperty(shape, "Prop", "Element");
                if ((groupElementName == null) || (elementName == null))
                {
                    continue;
                }

                GroupElement groupElement = new GroupElement(groupElementName);
                groupElementTable.AddGroupElement(groupElement);

                Element element = new Element(elementName);
                elementTable.AddElement(element);
            }
            report = ShapeGroupValidation.Validate(groupElementTable, elementTable, report);

            return(report);
        }
Esempio n. 3
0
        private string[] GetFields(IShapeHandler shape)
        {
            if (null == shape.GetProperties()["fields"])
                return new string[0];

            string fieldInfo = shape.GetProperties()["fields"].InnerXml;
            int begin = 0, end = 0, pointer = 0;

            List<string> toReturn = new List<string>();
            while (true)
            {
                begin = fieldInfo.IndexOf("<value>", pointer);

                if (-1 == begin)
                    break;

                pointer = begin;

                end = fieldInfo.IndexOf("</value>", pointer);
                pointer = end;

                toReturn.Add(fieldInfo.Substring(begin+7,end-(begin+7)));

            }
            return toReturn.ToArray();
        }