Exemplo n.º 1
0
        public void Evaluate(int spreadMax)
        {
            if (!SpreadUtils.AnyChanged(XML, Validation))
            {
                return;
            }

            RootElement.SliceCount = spreadMax;
            Document.SliceCount    = spreadMax;

            for (int i = 0; i < spreadMax; i++)
            {
                try
                {
                    var document = XMLNodes.AsDocument(XML[i], Validation[i]);
                    Document[i]    = document;
                    RootElement[i] = document.Root;
                }
                catch (Exception e)
                {
                    Document[i]    = null;
                    RootElement[i] = null;
                    FLogger.Log(e);
                }
            }
        }
Exemplo n.º 2
0
        public void Evaluate(int spreadMax)
        {
            if (!Attribute.IsChanged)
            {
                return;
            }

            Name.SliceCount     = spreadMax;
            Value.SliceCount    = spreadMax;
            Parent.SliceCount   = spreadMax;
            NodeType.SliceCount = spreadMax;

            for (int i = 0; i < spreadMax; i++)
            {
                string      name;
                string      value;
                XElement    parent;
                XmlNodeType nodeType;

                XMLNodes.Split(Attribute[i], out name, out value, out parent, out nodeType);

                Name[i]     = name;
                Value[i]    = value;
                Parent[i]   = parent;
                NodeType[i] = nodeType;
            }
        }
Exemplo n.º 3
0
        public void Evaluate(int spreadMax)
        {
            if (!SpreadUtils.AnyChanged(XML, Validation))
            {
                return;
            }

            RootElement.SliceCount  = spreadMax;
            Document.SliceCount     = spreadMax;
            Success.SliceCount      = spreadMax;
            ErrorMessage.SliceCount = spreadMax;

            for (int i = 0; i < spreadMax; i++)
            {
                try
                {
                    var document = XMLNodes.AsDocument(XML[i], Validation[i]);
                    Document[i]     = document;
                    RootElement[i]  = document.Root;
                    Success[i]      = true;
                    ErrorMessage[i] = null;
                }
                catch (Exception e)
                {
                    Document[i]     = null;
                    RootElement[i]  = null;
                    Success[i]      = false;
                    ErrorMessage[i] = e.Message;

                    FLogger.Log(LogType.Warning, e.Message);
                }
            }
        }
Exemplo n.º 4
0
        public void Evaluate(int spreadMax)
        {
            if (!Xml.IsChanged && !RngFile.IsChanged)
            {
                return;
            }

            Message.SliceCount = spreadMax;
            Valid.SliceCount   = spreadMax;

            for (int i = 0; i < spreadMax; i++)
            {
                var message = XMLNodes.RelaxNGValidate(Xml[i], RngFile[i]);
                Message[i] = message;
                Valid[i]   = message == "";
            }
        }
Exemplo n.º 5
0
        public void Evaluate(int spreadMax)
        {
            if (!Element.IsChanged)
            {
                return;
            }

            Name.SliceCount         = spreadMax;
            Value.SliceCount        = spreadMax;
            DeepValue.SliceCount    = spreadMax;
            Childs.SliceCount       = spreadMax;
            Attributes.SliceCount   = spreadMax;
            DocumentRoot.SliceCount = spreadMax;
            Parent.SliceCount       = spreadMax;
            Next.SliceCount         = spreadMax;
            NodeType.SliceCount     = spreadMax;

            for (int i = 0; i < spreadMax; i++)
            {
                string               name;
                string               value;
                string               deepvalue;
                ISpread <XElement>   childs;
                ISpread <XAttribute> attributes;
                XElement             documentRoot;
                XElement             parent;
                XElement             next;
                XmlNodeType          nodeType;

                XMLNodes.Split(Element[i], out name, out value, out deepvalue, out childs, out attributes,
                               out documentRoot, out parent, out next, out nodeType);

                Name[i]         = name;
                Value[i]        = value;
                DeepValue[i]    = deepvalue;
                Childs[i]       = childs;
                Attributes[i]   = attributes;
                DocumentRoot[i] = documentRoot;
                Parent[i]       = parent;
                Next[i]         = next;
                NodeType[i]     = nodeType;
            }
        }
Exemplo n.º 6
0
        public void Evaluate(int spreadMax)
        {
            if (!XML.IsChanged)
            {
                return;
            }

            RootElement.SliceCount = spreadMax;
            Document.SliceCount    = spreadMax;

            for (int i = 0; i < spreadMax; i++)
            {
                XElement  element;
                XDocument dom;
                XMLNodes.AsElement(XML[i], out dom, out element);
                Document[i]    = dom;
                RootElement[i] = element;
            }
        }